Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InlineShapes.AddOLEObject

Status
Not open for further replies.

figler

Programmer
Joined
Dec 26, 2001
Messages
155
Location
US
I never really figure out how to work with Range objects in Word (or Excel), and it is hurting me now...

I am building a Word document using the .Selection.TypeText Method. When I am all done, I want to insert the contents of another document into the end of the one I just built. It seems easy enough, but I am having all sorts of trouble. Can someone who is familiar with this please help? Thanks! (see code)

-Brad

ps Currently, I can embed the document at the *beginning* of my document. I would like to embed it at the end.

With WordDoc
If .EmbedDocument And .EmbedDocumentPath <> &quot;&quot; Then
If Dir(.EmbedDocumentPath) <> &quot;&quot; Then
oWordDoc.InlineShapes.AddOLEObject , _
.EmbedDocumentPath
Else
MsgBox &quot;The document to embed does not exist.&quot;
End If
End If
End With
 
Wow -- got it seconds after posting. The AddOLEObject method takes a Range object -- I just fed it oWord.selection.Range. Thanks anyway for reading this far!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top