Article View: adobe.scripting.indesign
Article #9838Re: [VB] How to apply ParaStyle to range of cells in table ?
From: Robert Tkaczyk
Date: Wed, 19 Jul 2006 12:48
Date: Wed, 19 Jul 2006 12:48
52 lines
2099 bytes
2099 bytes
> This also works. Does VB have ItemByRange?
yes
> myCells = app.selection[0];
> start = myCells.cells[0];
> end = myCells.cells[-1];
> myCells.cells.itemByRange(start, end).texts[0].appliedParagraphStyle = "table entry"
mySelCells.Cells.ItemByRange(mySelCells.Cells.Item(1),
mySelCells.Cells.Item(-1)).Texts.Item(1).AppliedParagraphStyle = _
myDoc.ParagraphStyles.Item("qqq")
err.number = 438
"Object doesn't support this property or method"
this works:
mySelCells.Cells.ItemByRange(mySelCells.Cells.Item(1),
mySelCells.Cells.Item(-1)).Item(1).Texts.ItemByRange( _
mySelCells.Cells.FirstItem.Texts.Item(1), _
mySelCells.Cells.LastItem.Texts.Item(1) _
).Item(1).AppliedParagraphStyle = _
myDoc.ParagraphStyles.Item("qqq")
but style all cells in rows :(
if table is (5,5) and selection is (2,2)-(4,4)
style will be applied to:
(2,2)-(5,2)
(3,3)-(5,3)
(1,4)-(4,4)
_____
_###_
_###_
_###_
_____
will be:
_____
_$$$$
$$$$$
$$$$_
_____
only workaround is to style in For...Next and narrow selection to cells in row and apply style to this sub-selection
robin
Technical Details
Message-ID:
<ACD91F267B95A035235CEBAD95D20B68@in.webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossingReferences:
<3bc0f55a.-1@webcrossing.la2eafNXanI> <3bc0f55a.2@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,a5d60b8eced08491 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Robert Tkaczyk <indesignscripts@wp.pl> Newsgroups: adobe.scripting.indesign Subject: Re: [VB] How to apply ParaStyle to range of cells in table ? Message-ID: <ACD91F267B95A035235CEBAD95D20B68@in.webcrossing.la2eafNXanI> Date: Wed, 19 Jul 2006 05:48:29 -0700 References: <3bc0f55a.-1@webcrossing.la2eafNXanI> <3bc0f55a.2@webcrossing.la2eafNXanI> Lines: 58 User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) X-Antivirus: avast! (VPS 0629-0, 2006-07-18), Outbound message X-Antivirus-Status: Clean MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news4.google.com!news2.volia.net!syros.belnet.be!news.belnet.be!news.stben.net!webcrossing