Chart object (Word)

Represents a chart in a document.

Remarks

The Example section describes the following properties and methods for returning a Chart object:

Example

The InlineShapes collection contains an object for each inline shape, including charts, in a document. Use InlineShapes ( Index ), where Index is the index number of an inline shape, to return a single InlineShape object. Use the HasChart property to determine whether the InlineShape object represents a chart. If the HasChart property is set to True, use the Chart property to return a Chart object.

You can also use the Type property to determine whether the InlineShape object represents a chart. If the Type property is set to WdInlineShapeChart, the inline shape represents a chart.

The following example verifies whether the first inline shape in the active document represents a chart. If so, the example changes the fore color of the first series on the chart.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.SeriesCollection(1).Format.Fill.ForeColor.RGB = rgbRed 
 End If 
End With

The following example creates a new 3-D column chart and adds it to the active document.

ActiveDocument.InlineShapes.AddChart Type:=xl3DColumn 

Methods

Name
ApplyChartTemplate
ApplyDataLabels
ApplyLayout
Axes
ChartWizard
ClearToMatchColorStyle
ClearToMatchStyle
Copy
CopyPicture
Delete
Export
FullSeriesCollection
GetChartElement
Paste
Refresh
SaveChartTemplate
Select
SeriesCollection
SetBackgroundPicture
SetDefaultChart
SetElement
SetSourceData

Properties

Name
Application
AutoScaling
BackWall
BarShape
CategoryLabelLevel
ChartArea
ChartColor
ChartData
ChartGroups
ChartStyle
ChartTitle
ChartType
Creator
DataTable
DepthPercent
DisplayBlanksAs
Elevation
Floor
GapDepth
HasAxis
HasDataTable
HasLegend
HasTitle
HeightPercent
Legend
Parent
Perspective
PivotLayout
PlotArea
PlotBy
PlotVisibleOnly
RightAngleAxes
Rotation
SeriesNameLevel
Shapes
ShowAllFieldButtons
ShowAxisFieldButtons
ShowDataLabelsOverMaximum
ShowLegendFieldButtons
ShowReportFilterFieldButtons
ShowValueFieldButtons
SideWall
Walls

See also

Word Object Model Reference