Article View: adobe.scripting.indesign
Article #17851Re: VB: Using the Index property of different objects
From: Olav Kvern
Date: Fri, 09 May 2003 05:39
Date: Fri, 09 May 2003 05:39
9 lines
1531 bytes
1531 bytes
Stephen-- The index property of a paragraph is really the index of the first character in the paragraph, as a character offset from the beginning of the story containing the paragraph. (The Scripting Guide actually notes this oddity.) So Paragraph.Index is only safe if you keep from adding or removing characters appearing before the paragraph in the story. The *real* index of the paragraph--Document.Story.Paragraphs.Item(x)--will not change unless you add or delete entire paragraphs before the paragraph. If you do, your object reference will become invalid. To avoid this, I have most of my text-changing scripts iterate backwards through the text in the story. Thanks, Ole
Technical Details
Message-ID:
<1de90e99.0@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de90e99.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,5e10f2c4fd84dbe6 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-05-08 23:07:28 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!216.166.71.118.MISMATCH!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!news2.euro.net!lnewspeer01.lnd.ops.eu.uu.net!emea.uu.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: VB: Using the Index property of different objects Message-ID: <1de90e99.0@WebX.la2eafNXanI> Date: Thu, 8 May 2003 22:39:04 -0700 References: <1de90e99.-1@WebX.la2eafNXanI> Lines: 17 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit