Chart.Paste method (Word)
Pastes chart data from the Clipboard into the chart.
Syntax
expression.Paste (Type)
expression A variable that represents a Chart object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Type | Optional | Variant | Specifies the chart information to paste if a chart is on the Clipboard. Can be one of the following values: 4104 Everything will be pasted. This is the default value. 4122 Copied source formats are pasted. 4123 Formulas are pasted. |
Example
The following example activates the Microsoft Excel workbook associated with the first chart in the active document. If the Excel workbook has multiple windows, the example activates the first window. The example then copies the contents of cells B1 through B5 and pastes the cell contents into the chart.
With ActiveDocument.InlineShapes(1)
If .HasChart Then
.Chart.ChartData.Activate
.Chart.ChartData.Workbook. _
Worksheets("Sheet1").Range("B1:B5").Copy
.Chart.Paste
End If
End With
See also
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.