🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17125

Re: VB - Fit content to cell

#17125
From: Iolaire McFadden
Date: Mon, 07 Jul 2003 16:12
20 lines
1854 bytes
Chris, thank you for the examples. I think that the text frame will not work as I'm looking at individual cells? But with your example I was able to think it through. (And also thanks - yes I did want to change tracking.)

Here is my code chunk so shrink down the contents of a cell to make it fit on one line:

' count the text lines to see if it overflows and wraps to another line
cell_lines = MyTable.Rows.Item(row_loop).Cells.Item(column_loop).TextLines.Count
'if it wraps to another line the text line count will be over 1
Do While cell_lines > 1.5
' get the current tracking / MyInsertionpoint = text just placed in the cell
MyIn_Tracking = MyInsertionpoint.Tracking
'compute a new tracking of current - 10
MyIn_New_Tracking = MyIn_Tracking - 10
' set the new tracking
MyInsertionpoint.Tracking = MyIn_New_Tracking
' count the text lines to see if it overflows and wraps to another line
cell_lines = MyTable.Rows.Item(row_loop).Cells.Item(column_loop).TextLines.Count
Loop

Thanks,
iolaire
Technical Details
Message-ID: <1de9c4c1.1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
References: <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-07 09:38:15 PST
From: "Iolaire McFadden" <imcfadden@costar.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!news.tele.dk!news.tele.dk!small.news.tele.dk!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: Re: VB - Fit content to cell
Message-ID: <1de9c4c1.1@WebX.la2eafNXanI>
Date: Mon, 7 Jul 2003 09:12:49 -0700
References: <1de9c4c1.-1@WebX.la2eafNXanI>
Lines: 27
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit