Class ChartCharacters (Word VBA)
The class ChartCharacters represents characters in an object that contains text. To use a ChartCharacters class variable it first needs to be instantiated, for example
Dim ccs as ChartCharacters
Set ccs = ActiveDocument.Background.Chart.ChartTitle.Characters
Caption
Returns the text of this range of characters.
ActiveDocument.Background.Chart.ChartTitle.Characters.Caption =
Count
Returns the number of objects in the collection.
Sub MakeSuperscript()
Dim n As Integer
With ActiveDocument.InlineShapes(1)
If .HasChart Then
n = .Chart.Title.Characters.Count
.Chart.Title.Characters(n, 1).Font.Superscript = True
End If
End With
End Sub
Delete
Deletes the object.
ActiveDocument.Background.Chart.ChartTitle.Characters.Delete
Font
Returns the font of the specified object.
Dim cftFont As ChartFont
Set cftFont = ActiveDocument.Background.Chart.ChartTitle.Characters.Font
Insert
Inserts a string preceding the selected characters.
Insert (String)
String: The string to insert.
Dim strString As String: strString =
ActiveDocument.Background.Chart.ChartTitle.Characters.Insert String:=strString
PhoneticCharacters
Returns or sets the phonetic text for the object.
With ActiveDocument.InlineShapes(1)
If .HasChart Then
.Chart.Title.Characters(1,3).PhoneticCharacters = "フリガナ"
End If
End With
Text
Returns or sets the text for the specified object.
ActiveDocument.Background.Chart.ChartTitle.Characters.Text =