Article View: adobe.scripting.indesign
Article #19613Finding the page/column of the end of a story
From: Greg Brunet
Date: Tue, 03 Dec 2002 03:58
Date: Tue, 03 Dec 2002 03:58
27 lines
2010 bytes
2010 bytes
I'm trying to find where a flowed story ends (Page & Column & distance into the column). I had been trying to use this code (where myTF is set to a known TextFrame in the story:
Private dLastHeight As Double
Dim myTF As InDesign.TextFrame
Dim myStory As InDesign.Story
Dim myTC As InDesign.TextColumn
Dim myChar As InDesign.Character
Dim Index As Long
'** go to the end of the story, and find out what page it's on
Set myStory = myTF.ParentStory '** point to the story
Set myTC = myStory.TextColumns(-1) '** get the last column
nLastPage = myTC.ParentTextFrame.Parent.Name '** get it's page #
nLastCol = myTC.ParentTextFrame.TextColumns.Count '** get it's column # on the page
Set myChar = myTC.Characters.Item(-1)
'** get last column height
dLastHeight = myChar.Baseline - PageBorder(nLastPage Mod 2).Top
The problem is that if I have pages at the end with linked textframes, then myStory.TextColumns(-1) points to the last one of those instead of the last one with actual text. Actually, even worse, it returns an InsertionPoint instead of a TextColumn, so the program blows up. Can anyone recommend how I can (easily/quickly(?)) find the page/column which has the end of the story? Thanks,
-- Greg
Technical Details
Message-ID:
<1de6d7df.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,9ae4ae1d51167ae9,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-12-02 20:08:10 PST From: "Greg Brunet" <gbrunet@sempersoft.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-08!supernews.com!newsfeed.online.be!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Finding the page/column of the end of a story Message-ID: <1de6d7df.-1@WebX.la2eafNXanI> Date: Mon, 2 Dec 2002 19:58:31 -0800 Lines: 33 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit