Hi,
I use the following code to merge excel data into seperate word (2000)documents.
Sub SaveEachDocument()
Application.DisplayAlerts = False
x = "C:\Data\test\"
With ActiveDocument.MailMerge.DataSource
.ActiveRecord = 1
Do Until .ActiveRecord = previousrecord
previousrecord = .ActiveRecord
.ActiveRecord = wdNextRecord
ActiveDocument.SaveAs x & .ActiveRecord & ".doc"
Loop
End With
ActiveDocument.Close
Application.DisplayAlerts = True
End Sub
This produces the documents but the merge fields are still in there. I want the merge fields to be replaced by the actual data like it does when you do a normal merge to a new document.
Anyone any ideas?
Thanks!
I use the following code to merge excel data into seperate word (2000)documents.
Sub SaveEachDocument()
Application.DisplayAlerts = False
x = "C:\Data\test\"
With ActiveDocument.MailMerge.DataSource
.ActiveRecord = 1
Do Until .ActiveRecord = previousrecord
previousrecord = .ActiveRecord
.ActiveRecord = wdNextRecord
ActiveDocument.SaveAs x & .ActiveRecord & ".doc"
Loop
End With
ActiveDocument.Close
Application.DisplayAlerts = True
End Sub
This produces the documents but the merge fields are still in there. I want the merge fields to be replaced by the actual data like it does when you do a normal merge to a new document.
Anyone any ideas?
Thanks!