InlineShapes.AddChart2 method (Word)

Adds a chart to the document. Returns an InlineShape object that represents the chart and adds it to the specified collection.

Syntax

expression.AddChart2 (Style, Type, Range, NewLayout)

expression A variable that represents an InlineShapes object.

Parameters

Name Required/Optional Data type Description
Style Optional INT32 The chart style. Use "-1" to get the default style for the chart type specified in Type.
Type Optional XLCHARTTYPE The type of chart.
Range Optional Variant The range where the chart will be placed in the text. The chart replaces the range, unless the range is collapsed. If this argument is omitted, the chart is placed automatically.
NewLayout Optional Variant If NewLayout is true, the chart is inserted by using the new dynamic formatting rules (Title is on, and Legend is on only if there are multiple series).
Type Optional XLCHARTTYPE

Return value

INLINESHAPE

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.