E
Ecos
Hello All,
I am using the following code to create individual MM object for each record
in my datasource. My goal is to be able to save each MM object as a file
instead of just opening it in wdSendToNewDocument. Any ideas? I am a
newbie at scripting so be gentle. Thanks!
Matt
***Code*********************
Sub MMerge()
'Create MM object
Set myMerge = ActiveDocument.MailMerge
For i = 1 To 10
'If MM object has valid Data Source, make it consist of the first 2
records
If myMerge.State = wdMainAndSourceAndHeader Or _
myMerge.State = wdMainAndDataSource Then
With myMerge.DataSource
.FirstRecord = i
.LastRecord = i
End With
End If
'Set the destination property of the MM object to the Printer and
execute it
With myMerge
.Destination = wdSendToNewDocument
.Execute
End With
Next i
End Sub
***EndCode************************
I am using the following code to create individual MM object for each record
in my datasource. My goal is to be able to save each MM object as a file
instead of just opening it in wdSendToNewDocument. Any ideas? I am a
newbie at scripting so be gentle. Thanks!
Matt
***Code*********************
Sub MMerge()
'Create MM object
Set myMerge = ActiveDocument.MailMerge
For i = 1 To 10
'If MM object has valid Data Source, make it consist of the first 2
records
If myMerge.State = wdMainAndSourceAndHeader Or _
myMerge.State = wdMainAndDataSource Then
With myMerge.DataSource
.FirstRecord = i
.LastRecord = i
End With
End If
'Set the destination property of the MM object to the Printer and
execute it
With myMerge
.Destination = wdSendToNewDocument
.Execute
End With
Next i
End Sub
***EndCode************************