View Single Post
  #5 (permalink)  
Old December 2nd, 2005, 09:55 AM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

Sure thing, but oddly enough there is not much to it. First I declare variables and assign their values to populate the parts of the DoCmd.SendObject method. They are marked with asterisks (*) below. Then I issue this statment:

DoCmd.SendObject acSendReport, strRptName, acFormatRTF, strTo, strCC, , strSubject, , True

- acSendReport is a report I wish to attach (Access constant)
- strRptName is the name of the report I wish to send*
- acFormatRTF means send the attachment as Rich Text Format (Access constant). Microsoft Word can open this easily.
- strTo is the recipient*
- strCC is the carbon copy recipient*
- strSubject is the subject line*
- True means don't send it right away; I wish to view the e-mail before sending it.

The only drawback to this is that the first time this code is excecuted, a Windows-generated dialog box opens asking you to confirm your default mail client. You have to click OK and then GroupWise will fire up and populate the e-mail. Subsequent use of this code will not invoke the dialog box until after you reboot. Even when I click "Use as Default", the dialog box will STILL appear after a reboot. I have not been able to figure out how to suppress this dialog box; but like I said, it only happens once per logon session.