WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE COM ADO CDO ADSI LDAP
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Vbscript Array in WIL

 Keywords: Array Variant Vb Vbscript WIL WinBatch OLE COM 

Question:

Starting to try and automate doc creation in InDesign with WinBatch. Code from the scripting ref manual for VB
Set myInDesign = CreateObject("InDesign.Application.CS3")
Set myDocument = myInDesign.Documents.Add
Set myTextFrame = myDocument.Pages.Item(1).TextFrames.Add
myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
myTextFrame.Contents = "Hello World!"
All works OK when converted except the
myTextFrame.GeometricBounds = Array("6p", "6p", "24p", "24p")
Any ideas as to how this should be coded in Winbatch?

Excel VBA shows the property as:

Property GeometricBounds As Variant
Member of InDesign.TextFrame
The bounds of the page item excluding the stroke width, in the format (top, left, bottom, right) as Array of 4 Units (Doubles or Strings) Tried using just...= ("6p", "6p", "24p", "24p") butthat also failed.

Answer:

You will need to pass it a WIL array. For Example:
myInDesign = CreateObject("InDesign.Application.CS3")
myDocument = myInDesign.Documents.Add()
myTextFrame = myDocument.Pages.Item(1).TextFrames.Add()

;Create a one dimensional WIL array with 4 elements
myArray = ArrDimension(4)
myArray[0] = "6p"
myArray[1] = "6p"
myArray[2] = "24p"
myArray[3] = "24p"
myTextFrame.GeometricBounds = myArray
myTextFrame.Contents = "Hello World!"

myTextFrame = 0
myDocument = 0
myInDesign = 0

User Reply:

You guys are the best. Works like a charm. Thank you.
Article ID:   W17438
File Created: 2008:04:10:15:10:26
Last Updated: 2008:04:10:15:10:26