Class ChartGroups (Word VBA)

The class ChartGroups represents one or more series plotted in a chart with the same format. To use a ChartGroups class variable it first needs to be instantiated, for example


Dim cgs as ChartGroups
Set cgs = ActiveDocument.Background.Chart.ChartGroups

For Each

Here is an example of processing the ChartGroups items in a collection.


Dim chrg As ChartGroup
For Each chrg In ActiveDocument.Background.Chart.ChartGroups
	
Next chrg

Count

Returns the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveDocument.Background.Chart.ChartGroups.Count

Item

Returns a single ChartGroup object from the collection.

Item (Index)

Index: The index number for the object.


With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.ChartGroups.Item(1).HasDropLines = True 
 End If 
End With