I am sure this is basic, but I cannot find any references on how to do it and my attempts have all failed. I am using VB and CS5.5
Basically what I am trying to do is select a table cell, and apply a character style to it, like so...
set myCharacterStyle = myDocument.CharacterStyles.Add
myCharacterStyle.Name = "TH2"
myTable2.Cells.Item(1).appliedCharacterStyle = "TH2"
with this code, I am getting a "Object doesn't support this property or method. myTable2.Cells.Item(...).appliedCharacterStyle"
I have tried several other versions without success.
Can anyone tell me what the proper syntax for applying a character style to the text in a table cell would be, or if this is even the right way to go about this?
Do I need to select the text in the cell rather than the cell itself, and if so, how do you do that?
You don't need to actually select the text in the cell, but you do need
to target it rather than the cell. It's true that in the UI you can
select the cell and apply a char style, but not with a script. So in
It must be something similar in VB as well.
Obviously you can target the text in many different ways:
myCell.characters.everyItem() or myCell.paragraphs.everyItem() etc. etc.
but I think that texts is the most basic of the lot.
thank you ariel. that worked great.
set myCell = myTable2.Cells.Item(1)
myCell.texts.item(1).appliedCharacterStyle = "TH2"