Article View: adobe.scripting.indesign
Article #17074Re: VB - Fit content to cell
From: Chris Haas
Date: Fri, 04 Jul 2003 02:38
Date: Fri, 04 Jul 2003 02:38
31 lines
2215 bytes
2215 bytes
ID has a pretty rich document model. A TextFrame is composed of paragraphs
which contains lines, words and characters. So if you have a 1 paragraph
textframe you'd find it's line count by doing this:
Set myP = myTextFrame.Parapgraphs.Item(1)
MsgBox(myP.TextLines.Count)
I assume you want to adjust tracking and not leading. Given myTF is your
textframe you could do something like this:
Set myP = myTF.Paragraphs.Item(1)
Do While myTF.TextLines.Count = 2
myP.Tracking = myP.Tracking - 10
Loop
Change the 10 if you want smaller increments, ID uses 10 by default in the
interface.
~Chris
"Iolaire McFadden" <imcfadden@costar.com> wrote in message
news:1de9c4c1.-1@WebX.la2eafNXanI...
> Hi, I'd like to fit the text content of a cell to the cell width so it
doesn't wrap onto two lines. My desired logic is to identify (test) a cell
which overflows or has text on two lines and to adjust it's Leading until
the test is false. However I can not find out how to measure the length of
the text or figure out how many lines it is.
>
> Please can someone suggest how to determine if the text in the cell wraps
or is longer than the cell width in Visual Basic?
> Thank you,
> iolaire
Technical Details
Message-ID:
<C7E974B6447F399E3A5D515876DB2671@in.WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de9c4c1.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,57c92f4cbe1a389b X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-07-03 20:07:56 PST From: "Chris Haas" <ChrisH@OvationAdvertising.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!news.webusenet.com!cyclone.bc.net!logbridge.uoregon.edu!xmission!nntp.infostrada.it!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: VB - Fit content to cell Message-ID: <C7E974B6447F399E3A5D515876DB2671@in.WebX.la2eafNXanI> Date: Thu, 3 Jul 2003 19:38:49 -0700 References: <1de9c4c1.-1@WebX.la2eafNXanI> Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit