I am trying to insert a MS Word Document object into another document through VBA. I can do this all day long if I give an absolute path.
However, if I try to use a relative path, I get the message:
“Word cannot obtain the data for the [document name] link.”
The code I am using to insert is:
Selection.InlineShapes.AddOLEObject ClassType:=”Word.Document.8″, FileName _
:=”Object1.doc”, LinkToFile:=False, DisplayAsIcon _
:=False
F.Y.I. I have tested inserting other documents with the same results, so I don’t think it is the document I am inserting that is causing the problem. Also, I tried replacing the file name here with a text file, and Word did allow that to be inserted from a relative path (although it kept inserting it as an icon, but it least it found it).
Thanks for your help!!
Troy