View Single Post
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default merge 2 docs-diff odd & even pages

I created this for someone else who want to do something similar.

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

Dim evenpage As Range

Set sourcea = Documents.Open(FileName:="...")

sourcea.Repaginate

Pages = ActiveDocument.BuiltInDocumentProperties(wdPropert yPages)

MsgBox Pages

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 'Assumed to be the document containing the even
pages

Selection.EndKey Unit:=wdStory 'Line of code added to start from the
end of the document

ActiveDocument.Bookmarks("\page").Range.Copy

Set targetrange = target.Range

targetrange.Start = targetrange.End

targetrange.Paste

targetrange.Start = targetrange.End

targetrange.InsertBreak Type:=wdPageBreak

Set evenpage = ActiveDocument.Bookmarks("\page").Range

evenpage.Start = evenpage.Start - 1

evenpage.Delete

Counter = Counter + 1

Wend

sourcea.Close wdDoNotSaveChanges

sourceb.Close wdDoNotSaveChanges

To get the page numbering that you want, I would use an Odd Page Header that
contains the following field construction

{ = { PAGE } / 2 }

You must use Ctrl+F9 to insert each pair of field delimiters { } and Alt+F9
to toggle off their display.

--
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

"gambledcat" wrote in message
...
How can I take two Word docs and merge them together so doc 1 is on the
left-hand (even numbered) pages and doc 2 is on the right-hand (odd
numbered)
pages? AND, if I can do this, is there a way to a) have doc 2 maintain its
unique page numbers? (hey, its christmas...miracle time, right?)

Here's what I'm doing:
I'm working on a long (200 page) Word document. It's a course curriculum.
I've got the student guide and the instructor guide as two separate
documents. For the final instructor guide, I would like to have the
teacher
page on the left-side pages and the student pages on the right-side pages.
That way the teacher can see what the students see as they see it in their
book. This means I need to keep the page numbers the same on the student
pages as they are in the student guide (so, we might be in page 40 of the
instructor guide, but only page 23 on the student guide).

My first thought was to make a .tiff image of each student page and insert
the images every other page. (lots of work, but it works) - the problem
comes
in if any changes are made to the student guide - all new page numbers and
re-doing all this work of making images and inserting them in just the
right
places (I did learn how to work a macro now...)

Thanks for any assistance.
Denise