Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Page Layout / January 2007

Tip: Looking for answers? Try searching our database.

Microsoft Word Document Merging

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck - 25 Jan 2007 16:16 GMT
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!!!!!
Signature

Chuck

Doug Robbins - Word MVP - 27 Jan 2007 20:03 GMT
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

Signature

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

>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
[quoted text clipped - 6 lines]
> Can this be done?  If so, how?
> Thanks!!!!!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.