Combine two document (even and odd pages)

K

Kevin

I have two documents that I scanned into a rich text format (.rtf). The
original document was two sided, so one document contains all the odd pages
and the other document contains all the even pages.

Is there a way to combine these documents automatically, without copying and
pasting them? The documents are rather large, so I would rather not do that.

Thanks.
 
D

Doug Robbins - Word MVP on news.microsoft.com

The following macro should do it:

Dim DocA As Document, DocB As Document, Target As Document
Dim prange As Range, trange As Range
Dim i As Long
Set DocA = Documents.Open("OddPageDocument")
Set DocB = Documents.Open("EvenPageDocument")
Set Target = Documents.Add
i = 0
While i < DocA.BuiltInDocumentProperties(wdPropertyPages)
DocA.Activate
Selection.HomeKey wdStory
Set prange = DocA.Bookmarks("\page").Range
prange.Cut
Set trange = Target.Range
trange.Collapse wdCollapseEnd
trange.Paste
DocB.Activate
Selection.HomeKey wdStory
Set prange = DocB.Bookmarks("\page").Range
prange.Cut
Set trange = Target.Range
trange.Collapse wdCollapseEnd
trange.Paste
i = i + 1
Wend


--
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, originally posted via msnews.microsoft.com
 

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