D
Dean Slindee
Using VisualStudio 2008 with Word 2007 to generate a contract and 6
appendices from 7 separate Word documents.
The code loads the base contract into a new Word app. Then it appends 6
documents to the ActiveDocument. Then it does a mail merge with the
following code:
'perform mail merge
Call CreateMailMergeDataFile(wrdApp, wrdDoc)
Dim wrdMailMerge As Word.MailMerge
wrdMailMerge = wrdDoc.MailMerge
wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument
wrdMailMerge.OpenDataSource(My.Settings.ModuleWorkPath &
"VendorContractMailMerge.doc")
wrdMailMerge.Execute(True)
Problem is, after the .Execute(True) statement, the mail merge is completed,
but what was a 23-page document becomes a 46-page document.
The first 23 pages have been successfully mail merged. The last 23 pages
are a duplicate of the first 23 pages, but with the mail merge fields
completely missing.
Anything I could do differently to prevent MailMerge from adding the
additional 23 pages?
Thanks in advance,
Dean Slindee
appendices from 7 separate Word documents.
The code loads the base contract into a new Word app. Then it appends 6
documents to the ActiveDocument. Then it does a mail merge with the
following code:
'perform mail merge
Call CreateMailMergeDataFile(wrdApp, wrdDoc)
Dim wrdMailMerge As Word.MailMerge
wrdMailMerge = wrdDoc.MailMerge
wrdMailMerge.Destination =
Word.WdMailMergeDestination.wdSendToNewDocument
wrdMailMerge.OpenDataSource(My.Settings.ModuleWorkPath &
"VendorContractMailMerge.doc")
wrdMailMerge.Execute(True)
Problem is, after the .Execute(True) statement, the mail merge is completed,
but what was a 23-page document becomes a 46-page document.
The first 23 pages have been successfully mail merged. The last 23 pages
are a duplicate of the first 23 pages, but with the mail merge fields
completely missing.
Anything I could do differently to prevent MailMerge from adding the
additional 23 pages?
Thanks in advance,
Dean Slindee