I am trying to open a series of Word documents and then
merge them into one larger document.
Allis going well until I get to a document that as a
Header....this does not get merged into the one larger
document.

The process I am using is:
objDoc = Documents.Open(FileName:=strDocumentName, _
ReadOnly:=False, _
PasswordDocument:="xxx", _
WritePasswordDocument:="xxx")
objWordApp.Selection.WholeStory ' *** this is not getting
the Header
objWordApp.Selection.Copy
objWordDoc.ActiveWindow.Activate ' activate new
document
objWordApp.Selection.MoveDown Unit:=wdScreen,
Count:=2
objWordApp.Selection.InsertBreak Type:=wdPageBreak
objWordApp.Selection.Paste

Can anyone please help me?

Thanks,
Barry

Merging documents by Caroline

Caroline
Wed Nov 05 05:15:47 CST 2003

Instead of using code to open, copy content then paste
why don't you use code to insert the file into
destination document.

Also use next page section breaks instead of page breaks
to separate the documents.

This should work providing the docs are not a mix of same
and different first page header/footer.

Hope helps
Caroline

>-----Original Message-----
>I am trying to open a series of Word documents and then
>merge them into one larger document.
>Allis going well until I get to a document that as a
>Header....this does not get merged into the one larger
>document.
>
>The process I am using is:
> objDoc = Documents.Open(FileName:=strDocumentName, _
> ReadOnly:=False, _
> PasswordDocument:="xxx", _
> WritePasswordDocument:="xxx")
> objWordApp.Selection.WholeStory ' *** this is not
getting
>the Header
> objWordApp.Selection.Copy
>objWordDoc.ActiveWindow.Activate ' activate new
>document
> objWordApp.Selection.MoveDown Unit:=wdScreen,
>Count:=2
> objWordApp.Selection.InsertBreak
Type:=wdPageBreak
> objWordApp.Selection.Paste
>
>Can anyone please help me?
>
>Thanks,
>Barry
>.
>