Class LegendEntries (Word VBA)

A collection of all the LegendEntry objects in the specified chart legend. To use a LegendEntries class variable it first needs to be instantiated, for example


Dim les as LegendEntries
Set les = ActiveDocument.Background.Chart.Legend.LegendEntries()

For Each

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


Dim lgne As LegendEntry
For Each lgne In ActiveDocument.Background.Chart.Legend.LegendEntries()
	
Next lgne

Count

Returns the number of objects in the collection.


Dim lngCount As Long
lngCount = ActiveDocument.Background.Chart.Legend.LegendEntries.Count

Item

Returns a single LegendEntry object from the collection.

Item (Index)

Index: The index number for the object.


With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 .Chart.Legend.LegendEntries.Item(1). _ 
 Font.Italic = True 
 End If 
End With