Howto use Insertfile method with object Reference rather than filename

Y

Yitzak

Hi I have 2 doc refs in code..

Page as word.document
NewDoc as word.document


for i = 1 to 10
' I would like it to work like this
NewDoc.insertfile (objectref := Page)
next

rather than
NewDoc.insertfile ("c:\temp\pagetempfile.doc")

The insertfile method needs a filename. I.E means I would have to save
the Page object to file first. Is there a way to achieve this without
the intermedery step of saving to a temp file.

Reason is Page object ref comes from an ole control - so I never have a
file for it..
 
C

Cindy Meister

In this case, you don't want to use Insert/File.

You might try this (or some variation thereof):

NewDoc.Range.FormattedText = Page.Range.FormattedText

-- Cindy
 

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