display email before sending it

kes

Registered User.
Local time
Today, 08:30
Joined
Mar 6, 2013
Messages
53
hi all,

I have theis code below in order to send query through outlook.
how can I display the mail and not directly sending it?

Private Sub Command64_Click()
Dim message As String

Dim rs As Recordset
Dim vRecipientList As String
Dim vMsg As String
Dim vSubject As String

Set rs = CurrentDb.OpenRecordset("SELECT * FROM Mail_list")
If rs.RecordCount > 0 Then
rs.MoveFirst
Do
If Not IsNull(rs!email) Then
vRecipientList = vRecipientList & rs!email & ";"
rs.MoveNext
Else
rs.MoveNext
End If

Loop Until rs.EOF

vMsg = "You have open Service Cost PMT Action Items assigned to you!(see attached)" & vbCrLf & "please update your AI status in the SharePoint : http://ent111.sharepoint.hp.com/teams/servicecr/Lists/Action%20Items/Karin.aspx"
vSubject = "Service Cost AI"
DoCmd.SendObject acSendQuery, "Service_Cost_AI", , vRecipientList, , , vSubject, vMsg, False
MsgBox ("Report successfully eMailed!")

End With

Else
MsgBox "No contacts."
End If


Exit Sub


End Sub
 
I found 2010 their, but I'm not sure that I understand the method explained their that can be connected to my code.
is there a docmd option?
 
Change the last parameter (EditMessage) to True.. It will display the mail, and wait for you to send the email..
Code:
DoCmd.SendObject acSendQuery, "Service_Cost_AI", , vRecipientList, , , vSubject, vMsg, [COLOR=Blue][B]True[/B][/COLOR]
 

Users who are viewing this thread

Back
Top Bottom