Mail Merge from vba Outlook using Word Template

W

Wouter

Hi all,

I'm trying to establish an email merge from Outlook.

Goal1: I've a e-mail merge template in Word and I would like to create a vba
script (outlook) that will email merge from outlook with the template I've in
Word.

The reason I want the code done in Outlook is that I then bypass the
security alerts build in Outlook. I assume, based on some stuff I read on
various web-sites, when you use vba outlook code, outlook will see this as
trusted and therefore won't alert.

Goal2: I've setup two accounts in outlook. One is the default account
(microsoft exchange server) and in that account I've got an other inbox. So
I'm able to send emails on behalf of that account. The emails I want to send
via mail merge should use this secondairy email address.

Could you explain how difficult it is, add some code snippets, and some
experiences.

Microsoft Office Professional 2003 SP3.
Please bare in mind that opt ins for Outlook to disable alerts is not an
option, unless you can setup rules to determine what kind of applications can
disable the alerts.



I'm not an advanced vba user so please keep it as simple as possible :)

'Do mailmerge
With ActiveDocument.MailMerge
.Destination = wdSendToEmail 'mail merge via email
.SuppressBlankLines = True 'do not attempt to send to blanc rows in
email field
With .DataSource 'fixed data source needs to be set in document
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
.Execute Pause:=True 'return error message if errors occur
End With

Many thanks! Wouter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top