Article View: adobe.scripting.indesign
Article #15979VB - Select certain cells in table for font application.
From: Gareth_Howell
Date: Wed, 29 Oct 2003 15:21
Date: Wed, 29 Oct 2003 15:21
31 lines
2381 bytes
2381 bytes
Right first off here is what I'm trying to achieve. I'm importing an excel spreadsheet into InDesign. I have then written a script that will format the table. My problem comes when I want to replace certain one characters cells with a new character and to change the font to in this case wingdings.
I've got the code below to work, but it is slow as it applies the font seperatly to each cell.
Private Sub bulletChange(ByVal tableObject)
For Each Row In tableObject.Rows
If Row.Cells.Item(1).Texts.item(1).pointsize = 8 Then
For Each Cell In Row.Cells
' a = l, b = m, c = l+
If Cell.Texts.item(1).TextContents.length < 3 And Cell.Texts.item(1).TextContents.length > 0 Then
Select Case Cell.Texts.item(1).TextContents
Case "l+"
Cell.Texts.item(1).TextContents = "c"
Case "l"
Cell.Texts.item(1).TextContents = "a"
Case "m"
Cell.Texts.item(1).TextContents = "b"
End Select
Cell.Texts.item(1).AppliedFont = mFont
End If
Next
End If
statusOfFormat.CurrentProgressBar.PerformStep()
Next
End Sub
I've tried to use the select function on the cell to select a group and then apply the font but I'm unable to highlight/ select more than one table.
Basically if someone can explain how to select certain parts of the table I should be able to figure it out for myself after that.
I need this solution to be programmtic.
Technical Details
Message-ID:
<2cce0c01.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!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,53aa855b6fb61343,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-10-29 07:37:57 PST From: Gareth_Howell@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: VB - Select certain cells in table for font application. Message-ID: <2cce0c01.-1@webx.la2eafNXanI> Date: Wed, 29 Oct 2003 07:21:33 -0800 Lines: 40 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit