B
Brossyg
I have some VBA code that creates an email in Access and sends it from
Outlook. It is based on a query with a list of email addresses. It sends the
first email to Outlook and then I have to manually click the SEND button in
Outlook ... and then the second email is sent to Outlook ... and so on...
The list of email addresses is getting quite long and I want to automate
clicking the SEND button in Outlook from the VBA script...but don't know how!
Here is the VB code currently that works perfectly as long as I manually
click the SEND button in Outlook for each email:
Dim counter As Integer
Dim origemailstosend As Integer
counter = 1
origemailstosend = Me![totalemails]
While counter <= origemailstosend
DoCmd.SendObject _
, _
, _
, _
[eMailclean], _
, _
"(e-mail address removed)", _
"Thank you for your purchase!", _
"Thank you for your purchase of the Money Matters handout and
bible study series." & Chr(13) & Chr(13) & "Your Username is: " &
[Acct_Number] & Chr(13) & "Your Password is: " & [ZipCode] & Chr(13) &
Chr(13) & "Please go to www.ourcompany.org and click on the Stewardship
Download Center to download your Money Matters files." & Chr(13) & Chr(13) &
"Sincerely," & Chr(13) & Chr(13) & "Customer Service" & Chr(13) & "our
company", _
True
Me![totalemails] = Me![totalemails] - 1
Requery
counter = counter + 1
Wend
DoCmd.Close
What I need to know is how to programatically click the SEND button in
Outlook in the VBA code, or another way to release the email so the WEND can
continue to loop without manually clicking the SEND button.
Or, is there a way to change Outlook to send/receive every second instead of
every minute (minimum normally).
Thanks for any help.
Outlook. It is based on a query with a list of email addresses. It sends the
first email to Outlook and then I have to manually click the SEND button in
Outlook ... and then the second email is sent to Outlook ... and so on...
The list of email addresses is getting quite long and I want to automate
clicking the SEND button in Outlook from the VBA script...but don't know how!
Here is the VB code currently that works perfectly as long as I manually
click the SEND button in Outlook for each email:
Dim counter As Integer
Dim origemailstosend As Integer
counter = 1
origemailstosend = Me![totalemails]
While counter <= origemailstosend
DoCmd.SendObject _
, _
, _
, _
[eMailclean], _
, _
"(e-mail address removed)", _
"Thank you for your purchase!", _
"Thank you for your purchase of the Money Matters handout and
bible study series." & Chr(13) & Chr(13) & "Your Username is: " &
[Acct_Number] & Chr(13) & "Your Password is: " & [ZipCode] & Chr(13) &
Chr(13) & "Please go to www.ourcompany.org and click on the Stewardship
Download Center to download your Money Matters files." & Chr(13) & Chr(13) &
"Sincerely," & Chr(13) & Chr(13) & "Customer Service" & Chr(13) & "our
company", _
True
Me![totalemails] = Me![totalemails] - 1
Requery
counter = counter + 1
Wend
DoCmd.Close
What I need to know is how to programatically click the SEND button in
Outlook in the VBA code, or another way to release the email so the WEND can
continue to loop without manually clicking the SEND button.
Or, is there a way to change Outlook to send/receive every second instead of
every minute (minimum normally).
Thanks for any help.