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
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