rename works/send object ???

grnzbra

Registered User.
Local time
Today, 21:02
Joined
Dec 5, 2001
Messages
376
I have the following commands

DoCmd.Rename rptstr, acReport, rsn!OldName
...
DoCmd.SendObject acSendReport, rptstr, acFormatSNP, str, , , rsn!SbjLine

The first line works. The names of the reports change

The second line also works - sort of.

The correct report gets e-mailed to the correct recipient. However, the attached file retains the old name. (Actually, the name that the attached file has is the original name of the report from way back when and which doesn't exist any more).

Does anyone have any idea of what's happening and why. The name change involves datestamping the name of the report so I need this to work. Otherwise I could just send them off and be done with them.
 
On the off chance that anyone is interrested, the problem is that when a report is e-mailed (even manually) the attached file takes the name of the Caption property of the report. If the caption is blank, it will take the name of the report. For my purposes, I added code to the OnOpen which set the Caption to the name I wanted for the exported file.
 
Rename report

On the off chance that anyone is interrested, the problem is that when a report is e-mailed (even manually) the attached file takes the name of the Caption property of the report. If the caption is blank, it will take the name of the report. For my purposes, I added code to the OnOpen which set the Caption to the name I wanted for the exported file.

Hi,
I was wondering how did you rename the attachment. I'm stuck.
Please help.
Thanks,
 
Got it

DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.CopyObject , "rptOrder" & [InputID], acReport, "rptOrder"
stDocName = "rptOrder" & [InputID]
DoCmd.SendObject acReport, stDocName, acFormatRTF, "sudspark@gmail.com", "", , "New JDA Order", "New JDA Order"
DoCmd.DeleteObject acReport, "rptOrder" & [InputID]
 

Users who are viewing this thread

Back
Top Bottom