PDA

View Full Version : Solved: Sending an Outlook message from Excel



pwesterink
09-01-2010, 11:53 PM
Hi, I'm a beginner in VBA, but excited about the possibilities.

I work with Office 2007. Is there anyone who can give me some VBA code that - when run in Excel 2007 - will generate and send an email message where I can enter Recipient, Subject, Body text and File attachment? I plan to have a list of recipients in Excel and write a routine that will go down the list and send all e-mail messages for me.

Many thanks!

Peter

Simon Lloyd
09-02-2010, 12:53 AM
Take a look at Ron De Bruins site on this matter:
http://www.rondebruin.nl/sendmail.htm

When you have got to grips with it you can then substitute SUBJECT, BODY etc with the contents of userform textbox

hitech
09-02-2010, 02:49 AM
You can find good article with examples frm rondebruin.nl.

Simon Lloyd
09-02-2010, 04:00 AM
Assuming all your email addresses are in column A sheet1 and are text rather than mailto hyperlinks, if they're hyperlinks then run this firstSub BreakMailLinks()
Cells.Hyperlinks.Delete
End SubThen import the .frm from the file attached, it should work fine for you!

I've just edited Ron De Bruins sendmail a little, but you get the idea if you want to use his cdo version so that you dont keep getting the security warning.

pwesterink
09-11-2010, 01:57 AM
Simon,

Thanks for your help. I did not expect such a fast response that was so on the mark. Ron de Bruin is a genius - I looked at some of his examples, took the simplest one and adjusted it until I was happy. Really quite powerful stuff. Many thanks, Peter
:clap: