Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report to Outlook

Status
Not open for further replies.

kenman

Programmer
Dec 21, 2000
12
0
0
US
I am currrently trying to attach a report called (rptQuotation) and fill in email address, subject, etc. to Microsoft outlook by using the DoCmd.SendObject.
The following is what I am using
DoCmd.SendObject acReport, "rptQuotation", acFormatXLS, "email@anywhere.com", , , "Quote", _
"Here is the quote you asked for", True


Everything works as expected. The name of the report that is attached to my email is called rptQuotation - as expected. I would like to make name of the emailed document dynamic per quote..to something a little more intelligent, as I send multiple quotes to the same customer very often...and I don't want the customer to have to manage the names. The caption property seems to be what drives the name of the report. I tried to set the caption in on Open Event, but this does not seem to have any affect (like it happens too late). I also tried to set the caption property to Me![QuoteNumber]. When I do this, the name of the attached document is Me![QuoteNumber].xls
I realize that I can use the DoCmd.OutputTo command and force a name in, but this requires the user to manually create the email. Any suggestions would be appreciated.

Thanks,
Ken
 
Hi Ken,
I think actually it's the report name that set the name of the attached object, so I'm afraid there's not a lot you can do about it.
Richard
:-(
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top