This content has been marked as final. Show 2 replies
> myTable.Cells.ItemByRange(1, -1).Item(1).Texts.Item(1).AppliedFont
VB is not JS ;)
from Olav's post:
"In VBScript, you'll need to iterate through the returned Objects collection. When you work with ItemByRange with text, you'll get an Objects collection containing a single item, so you can avoid iteration by setting the properties of that item. For other objects, you'll get multiple objects.
VBScript doesn't have the capability of applying a value to a property of multiple objects at once. Adding ItemByRange was about as close as we could get!"
so - you can set fill color, stroke color or other params of Cell when you use .Cells.ItemByRange() - but you can't change Text properties of these cells in one command
> For Each Cell In myTable.Cells
> myTable.Cells.Item(Cell).Texts.Item(1).AppliedFont = MyInd.Fonts.Item("Castellar")
> Next Cell
I think "Cell" is cell-type - not long-type
so probably you should write:
Cell.Texts.Item(1).AppliedFont = MyInd.Fonts.Item("Castellar")
and DON'T use For Each - becuase VB have limit to ONLY 255 items/iterations !
OK about "For Each..." Thanks.
And about "ItemByRange". We can apply table style to whole table (all cells), but cannot apply font, size... for whole table? Right?
OK. We'll iterate, ... or try JS!