Getting Range after Range.InsertFile

A

Art

Here is the situation; I have a FormField in a document where I'd like to
insert another document. After the insert I would like to get the Range for
this inserted document and for the love of God I can not figure it out. I
need to do some editing of this range before it can be displayed to the user:
Here is what I have so far (assume that cursor is already in the required
FormField)

CurrentRange.FormFields(1).Range.Collapse(ToStart)
CurrentRange.InsertFile("MyFile.doc")

Now, how do I expand the CurrentRange to encapsulate just inserted document?
I'm getting tons of errors regardless of what I try.
 
K

Klaus Linke

Hi Art,

Have you tried something like this, for example?

Dim lOldPos as Long
lOldPos=CurrentRange.Start
CurrentRange.InsertFile("MyFile.doc")
CurrentRange.Start=lOldPos

Regards,
Klaus
 

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