jadams0173
Technical User
- Feb 18, 2005
- 1,210
In the middle of a project I've been thrown a curve by the requester. They have just told me that on several occasions they insert other files into the word document like this. Insert > Object > Create from File > Browse > Select File and then they check the Display as Icon box.
I recorded a macro to see how I was to go about this and here is what I got.
Can this be done any better? A little reading here suggests that the macro recorder and InlineShapes are not always best friends. Some posts suggested there were limitations of inlineshapes when using the macro recorder.
Any thoughts?
I recorded a macro to see how I was to go about this and here is what I got.
Code:
Selection.InlineShapes.AddOLEObject ClassType:="AcroExch.Document.7", _
FileName:="C:\documents\AAA beach directions.pdf", LinkToFile:=False, _
DisplayAsIcon:=True, IconFileName:= _
"C:\WINDOWS\Installer\{AC76BA86-7AD7-1033-7B44-A80000000002}\PDFFile_8.ico" _
, IconIndex:=0, IconLabel:="""AAA beach directions.pdf"""
Can this be done any better? A little reading here suggests that the macro recorder and InlineShapes are not always best friends. Some posts suggested there were limitations of inlineshapes when using the macro recorder.
Any thoughts?