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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send an email without Outlook showing a dialog box with Attachm 1

Status
Not open for further replies.

maupiti

Programmer
Oct 27, 2003
240
US
Access 2003.

How to send an email without Outlook showing a dialog box, and with attachment.

The code below will send an email without showing the big
window, but it did not have a file attachment although
I did specify the name of the file which is
"Report_Drawing".

///////////////////////////////////////////

Private Sub Send_Email_To_A_Recipient_Automatically()

Dim stDocName As String
Dim Send_Email_To As String
Dim cc_field As String

stDocName = "Report_Drawing"
Send_Email_To = "john_Doe@abc.com"
cc_field = ""

DoCmd.SendObject , stDocName, "Snapshot Format",
Send_Email_To, cc_field, , _
"NCR Subject", "Hi. A Sales number " & Me!NCR & "
have just been generated.", False, "Clear Day"
End Sub
 
Hi,

I would suggest that you create a macro which sends your report (?), using fixed values for subject , recipeint etc. if it works, than convert the macro to visual basic in order to substitute the variable names (me!ncr etc).

EasyIT
 
Try this:
Code:
Private Sub Send_Email_To_A_Recipient_Automatically()

DoCmd.SendObject acSendReport, "Report_Drawing", , "john_Doe@abc.com", , , "NCR Subject", "Hi. A Sales number  " & Me!NCR & " has just been generated.", False, "Clear Day"

End Sub
Am not sure about your use of "Snapshot Format" though. I have removed that as it's not supported, at least not in my version of Access. Search Access VBA help for the SendObejct Method to get a full list of supported format variables.

[pc2]
 
Perhaps this ?
DoCmd.SendObject acSendReport, "Report_Drawing", acFormatSNP, "john_Doe@abc.com", , , "NCR Subject", "Hi. A Sales number " & Me!NCR & " has just been generated.", False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top