Mail Merge document with Macro

L

Lin

Hi,
I have a mail merge document that merged data from Access database. I would
like to send this mailmerged document as an attachment using macro. My macro
disappearing in the form letter which I created in the Mail merge doc. What
is wrong with
my code which I using in my mailmerge doc
Sub Macro1()
With Documents("Confirmation.doc").MailMerge
.MailAsAttachment = True
.Destination = wdSendToEmail
.MailSubject = "Special offer"
.MailAddressFieldName = "Email"
.Execute
End With
End Sub

Or Is there any other way I can do this word?

Thanks
 
D

Doug Robbins - Word MVP

When are you running the macro? When the mail merge main document is the
ActiveDocument.

Try using With ActiveDocument instead of With Documents("Confirmation.doc")
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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