Document merging & portrait/landscape problem

Z

zikkio

Hi all,

I need to merge a document into another, preserving portrait/landscape
page layout of the source doc.
I've noticed that a simple copy&paste from a word window to the other
does exactly what I need, but the same thing done via vbscript doesn't
work: the content of the original document is pasted into the output
doc, the section break is present but the page formatting is lost.
I've tried also a direct inserting of the file with
Selection.InsertFile method, but the result is the same (document
inserted, section break inserted, page orientation lost).

I'm using word 2003 sp3.

Any help will be appreciated.

TIA,
zikkio
 
D

Doug Robbins - Word MVP

Show us the code that you are using.

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

zikkio

Hi Doug,

here it is the code. First attempt, with copy&paste from one word doc
to the other:

'Opening the cover, copy and paste to the document
WordCover = Cover.Documents.Open(theCover.FileName)
Cover.ActiveDocument.select
Cover.selection.copy
objSelection.paste
Cover.Quit false
objSelection.InsertBreak 2

And this is the second attempt, with InsertFile:

objSelection.InsertFile theCover.FileName, , False, False, False
objSelection.InsertBreak 2

In both sample, objSelection is a Selection object taken from the
ActiveDocument of the destionation doc (word.application object).

Many thanks,
zikkio
 

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