DoCmd.SendObject Method (Access) acFormatPDF File Name Change

lhooker

Registered User.
Local time
Today, 19:09
Joined
Dec 30, 2005
Messages
405
Is there any way to change the .PDF file name from the number "1" to a name that I will give with the DoCmd.SendObject method (Access) acFormatPDF parameter ? Right now the attached file is named '1.PDF'.
 
What object are you sending? Is it a report? Can you show us your code?
 
I'm sending a report. Below is the code.

DoCmd.SendObject acSendReport, sRep, acFormatPDF, sAddr, , , sSubj, "Thank you for taking this survey. Attached is your copy of " & "'Survey Report'."
 
I'm sending a report. Below is the code.

DoCmd.SendObject acSendReport, sRep, acFormatPDF, sAddr, , , sSubj, "Thank you for taking this survey. Attached is your copy of " & "'Survey Report'."
So, the report's name is 1? Is that right?
 
I'm going to pass it from the form.
Okay, you could try the following code:
Code:
DoCmd.OpenReport "1", acViewPreview, , , acHidden
Reports![1].Caption = Forms!FormName.TextboxName
DoCmd.SendObject acSendReport, sRep, acFormatPDF, sAddr, , , sSubj, "Thank you for taking this survey. Attached is your copy of " & "'Survey Report'."
DoCmd.Close acReport, "1"
(untested)
Hope that helps...
 
I misread your question. The report name is not "1". I'll try the code tomorrow and get back to you. Thanks ! ! !
 
I misread your question. The report name is not "1". I'll try the code tomorrow and get back to you. Thanks ! ! !
Okay, let us know how it goes. Good luck!
 
Update . . . My e-mail finally arrived (hours later). It appears that when sending the MS Access e-mail with an attachment, the attachment has a filename of "#1.PDF", but when the reaches it's designation, it has my specified filename. Weird . . . Have heard of this before ? Now, I have to figure out why the delay with this MS Access e-mail. Thanks the alternate solution ! ! !
 
You could copy the report to a new name and send that?
 
Update . . . My e-mail finally arrived (hours later). It appears that when sending the MS Access e-mail with an attachment, the attachment has a filename of "#1.PDF", but when the reaches it's designation, it has my specified filename. Weird . . . Have heard of this before ? Now, I have to figure out why the delay with this MS Access e-mail. Thanks the alternate solution ! ! !
That sounds weird, but I can't say anything for sure without seeing your environment. Hope you find the answer soon.
 

Users who are viewing this thread

Back
Top Bottom