Hello,
I trying to using VBScript to populate a word document. I made a template word document (.dotx) with preset bookmarks for my VBScript to look for. I have no problem adding a string of text to the document but I run into a problem when I want to add a PDF file to the word document. Here is the code I used for adding the PDF:
Set pdf = doc.Bookmarks("pdf").Range.InlineShapes.AddOLEObject Left:=100, Top:=100, Width:=200, Height:=300, _ FileName:="C:/Users/Jeby/AppData/Local/Temp/S10/bullseye.pdf", DisplayAsIcon:=True
When I try running this script, I get an error that says "Expected end of statement" at character 74, which is after the AddOLEObject part of the script line. I've tried different variations of my code to try and troubleshoot but I keep getting an error. Can someone help me with this?
I trying to using VBScript to populate a word document. I made a template word document (.dotx) with preset bookmarks for my VBScript to look for. I have no problem adding a string of text to the document but I run into a problem when I want to add a PDF file to the word document. Here is the code I used for adding the PDF:
Set pdf = doc.Bookmarks("pdf").Range.InlineShapes.AddOLEObject Left:=100, Top:=100, Width:=200, Height:=300, _ FileName:="C:/Users/Jeby/AppData/Local/Temp/S10/bullseye.pdf", DisplayAsIcon:=True
When I try running this script, I get an error that says "Expected end of statement" at character 74, which is after the AddOLEObject part of the script line. I've tried different variations of my code to try and troubleshoot but I keep getting an error. Can someone help me with this?