Vba newbie rather in a dead-end

T

tf

Hello,

I know vba for access but not vba for word.

I can't use the solution proposed at
http://www.mvps.org/word/FAQs/MailMerge/MergeWithAttachments.htm
because I don't understand how to put the Outlook object with the code
below.
and where it fits in (moreover, I can't change the merge document for
history
purposes)


I used the macro recorder which gives me the
code :
It works perfectly but I want to add something like
..body="my text as I want "


----------------------------------------------------------------------
For Each afield In ActiveDocument.MailMerge.DataSource.DataFields
Selection.WholeStory
With ActiveDocument.MailMerge
.Destination = wdSendToEmail
.SuppressBlankLines = True
.MailSubject = "My subject is _____"
////////////////////////////////////////////////////////////////////////////
/////////////
///// here i wish to have : .body="my own text"
////////////////////////////////////////////////////////////////////////////
////////////
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord


End With
.Execute Pause:=False
End With

ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
Next afield
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi tf,

See the article “What do I do with macros sent to me by other newsgroup
readers

to help me out?” at:

http://www.mvps.org/word/FAQs/MacrosVBA/CreateAMacro.htm

The mailmerge to email function uses the content of the mailmerge main
document as the body of the email. If you want something else as the body
of the email message, you will have to do it someother way.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
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