Article View: adobe.scripting.indesign
Article #20509Grouping Problem in 2.0.1 (Windows)
From: Alex S McLellan
Date: Fri, 05 Jul 2002 19:31
Date: Fri, 05 Jul 2002 19:31
30 lines
1828 bytes
1828 bytes
I have a script that worked in 1.5.2 that created a variant array of pageitems from a collection of pageitems and then called the spread.groups.add method to group the pageitems. This script no longer works in 2.0.1. Here is an excerpt: Dim mGroup as Collection ... add some pageitems to the collection ... ReDim VarArray(mGroup.count) Dim i as Integer Dim mLayer as InDesign.Layer Dim GroupObject as InDesign.Group For i = 1 to mGroup.Count ����Set VarArray(i) = mGroup.Item(i) Next Set mLayer = MyDoc.Layers(1) Set GroupObject = MyDoc.Groups.Add(mLayer, VarArray) The last line results in error 80004005 Method 'Add' of object 'Groups' failed. If I change the code so that each page item is selected through the Document.Select method and then pass the Document.Selection variant array to this method, then it works fine but this seems like an awkward work-around. I've also checked the items in the collection and in the array and they are correctly recognized by VB as the TextFrames that they are. Can anyone see the problem? Could this be a bug in 2.0.1?
Technical Details
Message-ID:
<ef98046.-1@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,213cb1d59f47a65c,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-07-05 12:40:31 PST From: "Alex S McLellan" <alex.mclellan@moh.gov.on.ca> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!iad-peer.news.verio.net!news.verio.net!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Grouping Problem in 2.0.1 (Windows) Message-ID: <ef98046.-1@WebX.aaQKaf7vad4> Date: Fri, 5 Jul 2002 12:31:32 -0700 Lines: 38 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit