I have a legacy CS4 VBA script that I'm trying to get to run in the latest version, CS6, as we begin the process of upgrading. Script runs fine in CS4.
The script takes an object from an MSWord file and puts it into Indesign. Here is some simplified code:
'app.scriptPreferences.version = 6 'comment: try to change the version. no apparent change to script behavior.
set myIDDoc = CreateObject("InDesign.Application").ActiveDocument
set oStory = myIDDoc.LayoutWindows(1).ActivePage.Place("C:\Temp\Chart_Temp.doc", Array("0p0", "20p0"))
oStory.Rectangles(1).Graphics(1).Resize 50,50 ' make sure the graphic is not overset. (**error on this line**)
The actual object appears correctly, but the code gives the following error: "Error Number: 438 Error String: Object doesn't support this property or methd: 'ostory.Rectangles' "
I've been spinning my wheels on this for several days. Any help or advice is greatly appreciated.