Send a report via email as attatchement

benc

Registered User.
Local time
Today, 02:41
Joined
Dec 31, 2001
Messages
57
On my form i have created a button from the wizard and selected to email the report as an attatchment. when pressed the user is asked what format it should be sent in. Is there anyway we can specify in the code what format we want instead of leaving it up to the user.


Private Sub emailpartdetails_Click()
On Error GoTo Err_emailpartdetails_Click

Dim stDocName As String

stDocName = "rptIndividualPartfromfrmpartlistresults"
DoCmd.SendObject acReport, stDocName

Exit_emailpartdetails_Click:
Exit Sub

Err_emailpartdetails_Click:
MsgBox Err.Description
Resume Exit_emailpartdetails_Click

End Sub

I.e I would like to specify it to be excel 97-2000 as asked.

Thanks in advance
 
benc said:
DoCmd.SendObject acReport, stDocName

The wizard only did that much? You are missing a number of arguments to send the report out.

DoCmd.SendObject acReport, "MyReport", "MicrosoftExcelBiff8(*.xls)", "email@address.com", , , "Email Subject", "Email Message", False
 

Users who are viewing this thread

Back
Top Bottom