Word Selection and InsertFile

K

kaumil

I am trying to combine two word documents into a new document. The issue is
that the last page of the first document is an envelope and when I insert the
second document it takes the formatting of this envelope in the merged
document. How can I insert a file and retain the settings of the file
inserted?

I am using word application.Selection.InsertFile to insert files.

Thanks
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?a2F1bWls?=,
I am trying to combine two word documents into a new document. The issue is
that the last page of the first document is an envelope and when I insert the
second document it takes the formatting of this envelope in the merged
document. How can I insert a file and retain the settings of the file
inserted?

I am using word application.Selection.InsertFile to insert files.
At the end of the first document (envelope) you need to insert a section break
(InsertBreak) of the type "Next Page". Then set
Document.Sections(2).PageSetup.Papersize to the appropriate paper size for the
document you want to insert. You then insert the file into the second section's
range. Roughly:
Dim rng as Word.Range
Set rng = ActiveDocument.Sections(2).Range
rng.Collapse wdCollapseEnd
rng.InsertFile 'etc.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

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