Microsoft Word Document Merging

C

Chuck

I have existing documentation, an Instructor Guide and a Participant Guide.
I need to merge them in by some automated means so the pages align
numerically. Page one of the Instructor guide as the first page, page one of
the participant guide as the second page so when I print the document out and
put it in a binder, the pages are facing each other.

Can this be done? If so, how?
Thanks!!!!!
 
D

Doug Robbins - Word MVP

Here is the code for a macro that I created for someone who wanted to
compile a document with alternating pages coming from different source
documents.

Dim sourcea As Document, sourceb As Document, target As Document
Dim Pages As Integer, Counter As Integer
Dim targetrange As Range

Set sourcea = Documents.Open(FileName:="...")
sourcea.Repaginate
Pages = ActiveDocument.BuiltInDocumentProperties(wdPropertyPages)
Set sourceb = Documents.Open(FileName:="...")
Set target = Documents.Add
target.PageSetup.LeftMargin = sourcea.PageSetup.LeftMargin
target.PageSetup.RightMargin = sourcea.PageSetup.RightMargin
target.PageSetup.TopMargin = sourcea.PageSetup.TopMargin
target.PageSetup.BottomMargin = sourcea.PageSetup.BottomMargin
target.AcceptAllRevisions
Counter = 0
While Counter < Pages
sourcea.Activate
ActiveDocument.Bookmarks("\page").Range.Copy
Set targetrange = target.Range
targetrange.Start = targetrange.End
targetrange.Paste
ActiveDocument.Bookmarks("\page").Range.Cut
sourceb.Activate
ActiveDocument.Bookmarks("\page").Range.Copy
Set targetrange = target.Range
targetrange.Start = targetrange.End
targetrange.Paste
ActiveDocument.Bookmarks("\page").Range.Cut
Counter = Counter + 1
Wend
sourcea.Close wdDoNotSaveChanges
sourceb.Close wdDoNotSaveChanges

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

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