Email Based on a Form

dgaller

Registered User.
Local time
Today, 12:59
Joined
Oct 31, 2007
Messages
60
I have found and modified the following code to get me started in the direction I want to go. However I need help expanding it. Can I modify this code to prompt for an attachment and add a signature in the subject?

Signature being something like

John Smith
555-555-5555

Code:
Private Sub Command794_Click()
On Error GoTo Err_Command794_Click
Dim SendTo As String, MySubject As String, MyMessage As String
SendTo = ""
MySubject = Me.[Store #] & " " & Me.Subject & " - Task #" & Me.[Task ID]
MyMessage = ""
DoCmd.SendObject acSendNoObject, , , SendTo, , , MySubject, MyMessage, True
Exit_Command794_Click:
Exit Sub
Err_Command794_Click:
MsgBox Err.Description
Resume Exit_Command794_Click
 
The short answer: No.

What you want is probably not possible when using the SendObject method. You will need to use another method like Outlook Automation, SMTP, CDO, etc. based on what resources you have available.
 
Last edited:
I can live with not having an attachment but how about the signature? There is no way to force a new line in the "My Message section"?
 
I know I'm a little late, but try
MyMessage = chr(13) & ""
instead of MyMessage = ""

chr(13) is the code for a Carriage Return
also try different combinations with chr(10) which is a LineFeed character
 

Users who are viewing this thread

Back
Top Bottom