This documentation is archived and is not being maintained.

ChTitle Object


This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Aa190542.parchild(en-us,office.10).gifChTitle
Aa190542.space(en-us,office.10).gifAa190542.parchild(en-us,office.10).gif

Represents the title of a chart workspace, axis, or chart.

Using the ChTitle object

Use the HasTitle or HasChartspaceTitle property to enable titles.

The following properties return a ChTitle object:

The ChartSpace object’s ChartSpaceTitle property

The ChAxis object’s Title property

The ChChart object’s Title property

The following example adds a title to the first chart in Chartpsace1 and then formats the newly-created title.

Sub AddChartTitle()

    Dim Chart1Title
    Dim chConstants

    Set chConstants = ChartSpace1.Constants

    ' Enable the title for the first chart in the
    ' chartspace.
    ChartSpace1.Charts(0).HasTitle = True

    ' Set a variable to the chart title.
    Set Chart1Title = ChartSpace1.Charts(0).Title

    ' Set the caoption for the title.
    Chart1Title.Caption = "2000 Sales by Department"

    ' Set the title to display at the bottom of the chart.
    Chart1Title.Position = chConstants.chTitlePositionBottom

    ' Format the font used for the title.
    Chart1Title.Font.Bold = True
    Chart1Title.Font.Name = "Tahoma"
    Chart1Title.Font.Size = 16

End Sub

 

Show: