Hi, don't know VB but in JS you create a group first then add object to the group. Maybe that's the same for VB ? Hope it helps.
Yes, I can group the textFrames in js, but I tried that in VB, the above error appeared. Any help?Thanks
var myDocument = app.open("c:/test.indd")
var page1 = myDocument.pages.item(0)
var textFrame1 = page1.textFrames.item(0)
var textFrame2 = page1.textFrames.item(1)
var myObjectList = new Array
var myGroup = myDocument.groups.add(myObjectList) //here, it said invalid paramer.
How can I do with this?
Your array is empty. Try:
var myObjectList = new Array(textFrame1, textFrame2);
oh,yes,I forgot to add the textFrames to the array.
But how can I do this in VB.net?My code is like this:
Dim myDocument As InDesignServer.Document = oApp.Open("c:/test.indd")
Dim page1 As InDesignServer.Page = myDocument.Pages.Item(1)
Dim textFrame1 As InDesignServer.TextFrame = page1.TextFrames.Item(1)
Dim textFrame2 As InDesignServer.TextFrame = page1.TextFrames.Item(2)
Dim myGroup = myDocument.Groups.Add(myObjectList)//here, it said Unable to cast object of type 'System.Object' to type 'InDesignServer.Objects'
What should I define myObjectList?
Would you please share how you resolved this problem? Been pulling my hair out for a couple of hours on this one. All the samples I find out there are either for old VBScript or older VB.Net that still liked using arrays.
I had to convert lots of code to the new methodology when CS3 came out, but until now all my usage involed only arrays of integers or doubles, not arrays of Indesign objects.
MANY thanks if you can help.