Attach Report to email via Command button

X

xpnovice

Hi,

Attaching reports to an email.

I can manage this using a macro when the addressees are known and included
in the macro or via the Send to options when the user enters the addressees.

However, I want to use a command button to email the reports so that the
user can apply changing criteria to reports using a parameter query and be
able to select the addresses from their contacts list in Outlook. I have
this working well, except that the user has to select the mail format from
the "Select format" dialogue box when the command button is first selected.
As all the reports will be in RFT format I would like to have this format
selected automatically for the user. Any suggestions as to how I might
achieve this please?


Regards
John
 
T

Tom Wickerath

Hi John,
However, I want to use a command button to email the reports....
I have this working well, except that the user has to select the mail
format from the "Select format" dialogue box when the command
button is first selected. As all the reports will be in RFT format I would
like to have this format selected automatically for the user.

Use the following code in the click event procedure for your command button:

DoCmd.SendObject acReport, "YourReportNameGoesHere", _
OutputFormat:=acFormatRTF, To:=strRecipient, _
Cc:=strBMTFocal, Subject:=strSubject,
EditMessage:=True

You can supply the value for strRecipient, or I suppose you could simply not
pass in the To: or Cc: parameters, and let the user use their Outlook address
book.

Tom
____________________________________

:

Hi,

Attaching reports to an email.

I can manage this using a macro when the addressees are known and included
in the macro or via the Send to options when the user enters the addressees.

However, I want to use a command button to email the reports so that the
user can apply changing criteria to reports using a parameter query and be
able to select the addresses from their contacts list in Outlook. I have
this working well, except that the user has to select the mail format from
the "Select format" dialogue box when the command button is first selected.
As all the reports will be in RFT format I would like to have this format
selected automatically for the user. Any suggestions as to how I might
achieve this please?


Regards
John
 
T

Tom Wickerath

Hi John,

Glad I could help.


Tom
________________________________________

:

Tom,

Thank you, thats exactly what I needed.

Best Regards
John
 
Top