Code for sending email (1 Viewer)

nickblitz

Registered User.
Local time
Today, 08:22
Joined
Oct 29, 2012
Messages
30
ok, this code below is working but it does not show a pop up from outlook instead it sends the mail automatically.

I want to have a pop up as a new email message with the to list populated from the query when i click the button on the form. anyone can help? :(

Code:
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim strEmailAddress

Set MyDb = CurrentDb()
Set rsEmail = MyDb.OpenRecordset("Query Full Director", dbOpenSnapshot)

Do Until rsEmail.EOF
  strEmailAddress = strEmailAddress & rsEmail("Email") & ";"
  rsEmail.MoveNext
Loop

strEmailAddress = Left(strEmailAddress, Len(strEmailAddress) - 1)

DoCmd.SendObject , , acFormatRTF, strEmailAddress, _
, , strSubject, strEMailMsg, False, False

rsEmail.Close
Set rst = Nothing
 
Last edited:

tmd_63

Registered User.
Local time
Today, 01:22
Joined
Jul 30, 2008
Messages
25
Yes, I know how
 

tmd_63

Registered User.
Local time
Today, 01:22
Joined
Jul 30, 2008
Messages
25
Your DoCmd object needs formatting correctly.
DoCmd.SendObject ObjectType, ObjectName, OutputFormat, To, Cc, Bcc, Subject, MessageText, EditMessage, TemplateFile
The EditMessage must be set to -1 to allow for editing the message before sending. You have set the editmessage to 0 (false).
 

Users who are viewing this thread

Top Bottom