property that represents the state of the Bold property on the characters in a text range. Read/write.
MsoTriState can be one of these MsoTriState constants. |
msoCTrue Not used with this property. |
msoFalse None of the characters in the range are formatted as bold. |
msoTriStateMixed Return value indicating that the range contains some text formatted as bold and some text not formatted as bold. |
msoTriStateToggle Set value which toggles between msoTrue and msoFalse. |
msoTrue All characters in the range are formatted as bold. |
expression.Bold
expression Required. An expression that returns one of the objects in the Applies To list.
Example
This example tests all the text in the second story of the active publication and if it has mixed bolding, it sets all the text to bold. If the text is all bold or all not bold, a message is displayed informing the user there is no mixed bolding. For this code to execute properly, there need to be two or more stories with text in the active publication.
Sub BoldStory()
Dim stf As Publisher.Font
Set stf = Application.ActiveDocument.Stories(2).TextRange.Font
With stf
If .Bold = msoTriStateMixed Then
.Bold = msoTrue
Else
MsgBox "Mixed bolding is not in this story."
End If
End With
End Sub