I have created a tool that writes out a Word document based on text stored in a spreadsheet.
The last part of the process is to embed a PDF file into the Word document, unlinked and displayed as an icon.
This code works fine when run in Word but when run from Excel inserts the file contents which is not what I want (and is unreadable anyway).
For information wrdDoc is created like this:wrdDoc.Shapes.AddOLEObject Anchor:=wrdApp.Selection.Range, ClassType:= _ "AcroExch.Document.7", Filename:=UserForm1.Controls("TextBox" & FileRef).Value, _ LinkToFile:=False, DisplayAsIcon:=True
and the Filename:= is passed as a fully qualified text string.Set wrdApp = CreateObject("Word.Application") Set wrdDoc = wrdApp.documents.Add(Template:=FullDotName)
Any ideas how I can get the file embedding to work?
Last edited by BillWilts; 06-10-2011 at 07:56 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks