Article View: adobe.scripting.indesign
Article #8120Re: [VBA CS2] Random text formatting errors and general slow down
From: Stan_Wise
Date: Fri, 03 Nov 2006 21:32
Date: Fri, 03 Nov 2006 21:32
22 lines
2182 bytes
2182 bytes
Robin and Ole,
Thanks for your help. I will try your solutions.
I cannot use a tagged text file because I need to paste the elements of the entries to a line in the InDesign file, measure the horizontal offset, and if it is within certain parameters, leave it alone; within other parameters, adjust the tracking so that it fits within the first set of parameters; or remove elements of the entry and paste them to a new line. I can't simply base these decisions on a character count of my field data because horizontal space on a page is affected by font type and on which specific characters are used because an "i" takes up less space than a "w" or an "e" for that matter.
If the script can't make these decisions, I might as well export the database to an Excel file and then import that file and format each entry by hand, which is what we were doing before I wrote the script.
I will try referencing paragraphs since each line ends up being it's own paragraph, anyway. However, there are parts of the script where I paste entry elements to "myStory.InsertionPoints(-1).Contents" and the same random errors occur.
Ole, since you ask, I am referencing myLine2 like so:
Set myInDesign = CreateObject("InDesign.Application.CS2")
Set myDocument = myInDesign.ActiveDocument
Set myStory = myDocument.Stories.Item(2)
Set myLine2 = myStory.Lines.Item(-2)
I will let you guys know the results of your solutions this afternoon. To paraphrase Dexter, "Work time is over. Food time is now."
Thanks again,
Stan
Technical Details
Message-ID:
<3bc22c46.3@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.albasani.net!news.isoc.lu!webcrossingReferences:
<3bc22c46.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,b7d54ad66a4bb92b X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Stan_Wise@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news3.google.com!news2.volia.net!news.ecp.fr!news.albasani.net!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: [VBA CS2] Random text formatting errors and general slow down Message-ID: <3bc22c46.3@webcrossing.la2eafNXanI> Date: Fri, 3 Nov 2006 13:32:21 -0800 References: <3bc22c46.-1@webcrossing.la2eafNXanI> Lines: 36 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit