Need help creating an alternate way to place .jpg via URL
I've created a 20-page layout where each page contains product photos arranged in a grid. These photos are posted on our web site and are updated often. To create the document, I laid out my frames and then placed the URL for each image. E.g., File -> Place -> Filename = http://corpwebsite/products/productphoto1.jpg. I repeated this for all of the products. I am using this approach because I don't have access to the server where the photos are stored and it saves me from having to get copies of each photo and move them to my local hard drive. I want to automate this process so I wrote a script that would read each URL from an Excel file and place the URL. The code that doesn the place is:
Set myInDesign = CreateObject("InDesign.Application.CS4")
Set myDocument = myInDesign.ActiveDocument
Rem Specify page 5
Set myPage = myDocument.Pages.Item(5)
Rem Specify 1st frame
Set myTextFrame1 = myPage.Rectangles.Item(1)
myTextFrame1.place("http://corpserver/products/econoline.jpg")
It fails on the last line. The error message says "Cannot find the folder." It works if I replace the last line with a reference to an image stored locally:
myTextFrame1.place("C:\mypictures\econoline.jpg")
I have no idea why a scripted Place command would work differently then manually selecting File -> Place, typing a URL and clicking OK, but that's the reality. So, what I want to do now is update my script to display the Place dialog box, paste a URL into the dialog box and click the OK button. Unfortunately, I cannot find any info on how to issue keystrokes from within a VB script.
Can anyone tell me the syntax I need to have a script:
Display the Place dialog box (CTRL + D)
Paste a value into it (CTRL + V)
Click OK
Using VB, please. Thank you.