Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Send unattended email from Outlook using Excel macro

I found some code online that I'm trying to modify for my needs. We are
using Outlook & Excel 2003 and I'm trying to have Excel send a message
without any user interaction. I'm trying to get around the "virus warning"
notification and they wont allow us to install any 3rd party apps. Here is a
sample of the code.

With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Daily Run is Complete"
.Body = strbody
.Send ' virus msg pops up after this line
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "{TAB}{TAB}", True
' Application.SendKeys "{LEFT}", True
Application.SendKeys "{ENTER}", True
End With

I don't know if I have the correct syntax for the send keys, but I'm trying
to wait 4 seconds for the "Yes" option to become available, then either hit
the left arrow once or the tab key twice before hitting Enter. The problem
is that the VBA code doesn't continue processing anything after the ".Send"
line while that dialog box is up. Is there anyway around this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send unattended email from Outlook using Excel macro

Hi PJ

SendKeys is not always reliable and this will not work correct on every computer

Check out CDO or upgrade one machine to Office 2007 (no warnings then)
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"PJ" wrote in message ...
I found some code online that I'm trying to modify for my needs. We are
using Outlook & Excel 2003 and I'm trying to have Excel send a message
without any user interaction. I'm trying to get around the "virus warning"
notification and they wont allow us to install any 3rd party apps. Here is a
sample of the code.

With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Daily Run is Complete"
.Body = strbody
.Send ' virus msg pops up after this line
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "{TAB}{TAB}", True
' Application.SendKeys "{LEFT}", True
Application.SendKeys "{ENTER}", True
End With

I don't know if I have the correct syntax for the send keys, but I'm trying
to wait 4 seconds for the "Yes" option to become available, then either hit
the left arrow once or the tab key twice before hitting Enter. The problem
is that the VBA code doesn't continue processing anything after the ".Send"
line while that dialog box is up. Is there anyway around this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Send unattended email from Outlook using Excel macro

Hi Ron,

I didn't realize you browsed these forums. The code sample I posted came
from your site in case you didn't recognize it. I did find the CDO example
and was able to get that to work, so thank you. I just want to make a slight
change so the recipient addresses are not hard coded in the macro but taken
directly from my spreadsheet. That will make it easier for others to update
the distribution list if necessary.

I'll attempt to make those changes on my own and open a new thread if I
can't figure it out.

Cheers!

"Ron de Bruin" wrote:

Hi PJ

SendKeys is not always reliable and this will not work correct on every computer

Check out CDO or upgrade one machine to Office 2007 (no warnings then)
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"PJ" wrote in message ...
I found some code online that I'm trying to modify for my needs. We are
using Outlook & Excel 2003 and I'm trying to have Excel send a message
without any user interaction. I'm trying to get around the "virus warning"
notification and they wont allow us to install any 3rd party apps. Here is a
sample of the code.

With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Daily Run is Complete"
.Body = strbody
.Send ' virus msg pops up after this line
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "{TAB}{TAB}", True
' Application.SendKeys "{LEFT}", True
Application.SendKeys "{ENTER}", True
End With

I don't know if I have the correct syntax for the send keys, but I'm trying
to wait 4 seconds for the "Yes" option to become available, then either hit
the left arrow once or the tab key twice before hitting Enter. The problem
is that the VBA code doesn't continue processing anything after the ".Send"
line while that dialog box is up. Is there anyway around this?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send unattended email from Outlook using Excel macro

Hi PJ

See the Tips and links on the same page




--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"PJ" wrote in message ...
Hi Ron,

I didn't realize you browsed these forums. The code sample I posted came
from your site in case you didn't recognize it. I did find the CDO example
and was able to get that to work, so thank you. I just want to make a slight
change so the recipient addresses are not hard coded in the macro but taken
directly from my spreadsheet. That will make it easier for others to update
the distribution list if necessary.

I'll attempt to make those changes on my own and open a new thread if I
can't figure it out.

Cheers!

"Ron de Bruin" wrote:

Hi PJ

SendKeys is not always reliable and this will not work correct on every computer

Check out CDO or upgrade one machine to Office 2007 (no warnings then)
http://www.rondebruin.nl/cdo.htm

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"PJ" wrote in message ...
I found some code online that I'm trying to modify for my needs. We are
using Outlook & Excel 2003 and I'm trying to have Excel send a message
without any user interaction. I'm trying to get around the "virus warning"
notification and they wont allow us to install any 3rd party apps. Here is a
sample of the code.

With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Daily Run is Complete"
.Body = strbody
.Send ' virus msg pops up after this line
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "{TAB}{TAB}", True
' Application.SendKeys "{LEFT}", True
Application.SendKeys "{ENTER}", True
End With

I don't know if I have the correct syntax for the send keys, but I'm trying
to wait 4 seconds for the "Yes" option to become available, then either hit
the left arrow once or the tab key twice before hitting Enter. The problem
is that the VBA code doesn't continue processing anything after the ".Send"
line while that dialog box is up. Is there anyway around this?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to remove the outlook confirm window when use excel to send email from outlook? Tom Cai Excel Programming 3 March 4th 09 03:35 AM
send email macro with Outlook running DaveH Excel Programming 0 May 22nd 08 06:14 PM
How to send a single page email from excel 2000 using outlook xp vols2812 Excel Worksheet Functions 1 December 30th 06 06:45 PM
Send an email attachment (pdf file) from Excel 2003 using Outlook Express [email protected] Excel Programming 6 November 16th 06 03:02 PM
***** PLEASE HELP **** Send an email from Excel to outlook with an automatic macro SAM SEBAIHI Excel Discussion (Misc queries) 0 November 11th 06 08:17 AM


All times are GMT +1. The time now is 08:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"