Question
Finding File Name And Using It To Place The Graphic Using VBscript
I'm trying to find a file name (example, <place:E:\logo.tif>) in each text frame if it's there, then remove the text from the frame and then place the file in the frame. This is to get around the feature missing from InDesign that is in PageMaker that allowed you to import inline graphics using tagged text. Below is what I have come up with so far. The file name is currently hard coded in the example below.
Thanks,
Archie
For I = 1 to cInt(myMountNumber)
Set myTextFrames = myDocument.TextFrames
Set myCurrentFrame = myTextFrames.Item(I)
If myCurrentFrame.Texts.ItemByRange (1,7).Contents = "<Place:" Then
Set myLastCharacter = myCurrentFrame.Characters.Item(-2)
myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents = ""
myCurrentFrame.InsertionPoints.Item(1).Place ("E:\sxs\pm65\Sundco.jpg")
myCurrentFrame.Fit idFitOptions.idProportionally
End If
Next
Thanks,
Archie
For I = 1 to cInt(myMountNumber)
Set myTextFrames = myDocument.TextFrames
Set myCurrentFrame = myTextFrames.Item(I)
If myCurrentFrame.Texts.ItemByRange (1,7).Contents = "<Place:" Then
Set myLastCharacter = myCurrentFrame.Characters.Item(-2)
myCurrentFrame.Texts.ItemByRange (1,myLastCharacter).Item(1).Contents = ""
myCurrentFrame.InsertionPoints.Item(1).Place ("E:\sxs\pm65\Sundco.jpg")
myCurrentFrame.Fit idFitOptions.idProportionally
End If
Next