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

The following procedures can be used to set variables of type ChartCharacters: AxisTitle.Characters, ChartTitle.Characters, DataLabel.Characters and DisplayUnitLabel.Characters.


Returns the text of this range of characters.

ActiveDocument.Background.Chart.ChartTitle.Characters.Caption =


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


Deletes the object.



Returns the font of the specified object.

Dim cftFont As ChartFont
Set cftFont = ActiveDocument.Background.Chart.ChartTitle.Characters.Font


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


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


Returns or sets the text for the specified object.

ActiveDocument.Background.Chart.ChartTitle.Characters.Text =