Article View: adobe.scripting.indesign
Article #14727[VB] Grouping textframes and error logs
From: Petter_E_Mahlen
Date: Mon, 19 Jan 2004 13:12
Date: Mon, 19 Jan 2004 13:12
29 lines
2760 bytes
2760 bytes
Hi,
I have been trying for a couple of days now to produce a catalog application, which should select information from a database and format it into an InDesign document. The result should be a table, and there will be some 300 entries in the table, so it will be flowing across some 50-60 pages. My client will be doing a lot of manual layouting work once the export from the database is done, so I am not concerned with actually getting the table to be presented on the correct number of pages. It is important, though, to get the formatting right so that it is easy for them to work with the result. I am a complete newbie with regard to InDesign (and not an expert VB programmer either, although I have been working with a lot of other programming languages). What I am trying to do is to put together a group of two text frames for each catalog item. This group should then be placed inside a table cell (one cell per table row). However, when I try to group the two text frames, I get an error saying:
--------
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in microsoft.visualbasic.dll
Additional information: Unspecified error
--------
The code where it happens is:
--------
Dim group As InDesign.Group
Dim groupElements(2) As Object
groupElements(0) = bgFrame
groupElements(1) = nameFrame
group = doc.Pages.Item(1).Groups.Add(doc.Layers.Item(1), groupElements) ' THIS ROW FAILS
--------
bgFrame and nameFrame are both InDesign.TextFrame objects, and I have tried making the groupElements array into an array of TextFrames as well, and I have tried skipping the optional layer paramter ( ...Add(, groupElements). No difference in the result.
The first question is of course: what am I doing wrong? The second question is: I have seen this error message quite a few times before, but have been able to get past it by lucky guesses, trial and error or by looking through these forums. Is it possible to get more detailed error messages than that through some log in InDesign or Visual Studio?
Thanks in advance for any help,
Petter M�hl�n
Technical Details
Message-ID:
<2ccf7276.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!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,43e5036ba6d1f8a5 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2004-01-19 05:37:37 PST From: Petter_E_Mahlen@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: [VB] Grouping textframes and error logs Message-ID: <2ccf7276.-1@webx.la2eafNXanI> Date: Mon, 19 Jan 2004 05:12:14 -0800 Lines: 51 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit