View Single Post
  #5   Report Post  
Doug Robbins
 
Posts: n/a
Default

Yes, the path and the filename.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"ejbSF" wrote in message
...
Thanks for the reply, Doug.

I copied the macro into a "new macro" subroutine, but it immediately
crashes on the "set sourcea = documents.open(filemame:"...") line.

Should I be putting the name of my saved file in place of the dots? Same
answer to "set sourceb", I assume.

Anything else I need to add in?

Ed


"Doug Robbins" wrote:

Here's a macro that I put together for someone who wanted to create a
single
document by alternately inserting pages from two other documents. You
might
be able to use it to do what you want

Dim sourcea As Document, sourceb As Document, target As Document,
Pages
As Long, Counter As Long

Dim evenpage As Range, targetrange 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

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a
paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
"ejbSF" wrote in message
...
I need to produce a booklet with different stories on facing pages.

An English version and Italian version of an article must appear on
facing
pages. The article is multi-page, so the text must continue in the
facing
page pattern.

In other words, the English will be on pages 2,4,6,8, and the Italian
on
pages 3,5,7,9, etc.

I've created many booklets (and books) in Word but I've never had to
intermix texts like this before.

Any suggestions?
Thanks,
Ed