Hi all
just out of curiosity ... i would like to know if it is possible to get the report name as an email subject ... once the report has been put in pdf?![]()
Hi all
just out of curiosity ... i would like to know if it is possible to get the report name as an email subject ... once the report has been put in pdf?![]()
You would have to do it when creating the pdf and normally you would do something like:
DoCmd.SendObject acSendReport, "YourReportName", acFormatPDF, "SendToEmail", , , "YourReportName", "YourText", True
I will say yes. What procedure are you using to create the pdf?
Here is one example of code sending email. https://www.accessforums.net/access/...ess-28311.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
im using a macro to send the report in pdf to be emailed.
I use only VBA so not sure how macro would handle this. I would have to review code if you want to provide db. Follow instructions at bottom of my post.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
i would upload the database but it is to huge ....
Did you make copy, remove confidential data, delete records (a few for testing would be nice), run Compact & Repair, zip? Still too large? Can upload to fileshare site such as Box.com and post link to the file.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Private Sub Command21_Click()
On Error GoTo Command21_Click_Err
DoCmd.SendObject acSendReport, "Search_by_Clusters and date", "PDFFormat(*.pdf)", "", , , Text28.Value = namepri, "", True
Command21_Click_Exit:
Exit Sub
Command21_Click_Err:
Select Case Err.Number
Case 2501
MsgBox "You have not sent an email.", vbInformation
Case Else
MsgBox "Error " & Err.Number & " " & Err.Description
End Select
Resume Command21_Click_Exit
End Sub
so the above code works well with putting the report in PDF , but my subject line does not seem to wanna bring the report name
June 7 i aint sure if you can help but i have recoded this thing from a macro to VBA
The argument cannot be an equation. That makes no sense. The result of the equation is either True or False (-1 or 0) and that would be the Subject. What were you intending by using the equation: Text28.Value = namepri ?
DoCmd.SendObject acSendReport, "Search_by_Clusters and date", "PDFFormat(*.pdf)", "", , , "Search_by_Clusters and date", "", True
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.