Is it possible Inserting a Range object at a specified location.

A

agrogers

Hi
I want to create a range object which holds a section of document 1 and
then insert that range section into another document. But i can't see
an InsertRange method or the like. Is there any way of doing this?
Thanks
Andrew
 
A

agrogers

Having looked a little further it seems that it is not possible to
insert a Range into a document (eg Selection.InsertRange MyRange).
However it does look like i could use the AutoText object by saving the
range as an AutoText entry and then inserting the Autotext entry where
i need it.

Is this really the best option?

Thanks
Andrew
 
H

Helmut Weber

Hi,
like this:

Sub Test5700()
Dim DocSource As Document
Dim Doctarget As Document
Set DocSource = Documents("27.doc")
Set Doctarget = Documents("28.doc")
Dim rDoc1 As Range
Set rDoc1 = DocSource.Range(0, 30)
Doctarget.Range(100, 100).InsertAfter rDoc1
End Sub

Though I'r rather use the range's formattedtext,
than the range itself.

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 

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