SetCharStyle Method

Sets the font style (bold, italic, underline, etc.) for the specified character block of the shape's text.

Applies to: Shape object

Syntax

object.SetCharStyle ( iFrom, iTo, bStyle )

The SetCharStyle method syntax has these parts:

Part Description
object

Required. An expression that returns a Shape object.

iFrom Required. An expression that returns a Long value. The index of the first character in the character block.
iTo Required. An expression that returns a Long value. The index of the last character in the character block.
bStyle Required. An expression that returns a Byte value. The font style.

Remarks

Note, that if the character block collection of the shape doesn't include the character block within the iFrom to iTo range, the SetCharStyle method adds a new character block and sets the specified font style to it.

Below is the list of possible values of the bStyle parameter:

Constant Value Description
cdFSNormal 0 Normal.
cdFSBold 1 Bold.
cdFSItalic 2 Italic.
cdFSUnderline 4 Underline.
cdFSStrikeTrough 8 Strikethrough.

 

See Also

Character method, CharactersNum method, GetCharacterIndex method, RemoveCharacter method, SetCharColor method, SetCharFont method, SetCharHyperlink method, SetCharLanguage method, SetCharPos method, SetCharSize method, SetCharSpacing method, Character object