Class Axes (Word VBA)

The class Axes represents a collection of all the Axis objects in the specified chart. To use a Axes class variable it first needs to be instantiated, for example


Dim axs as Axes
Set axs = ActiveDocument.Background.Chart.Axes()

For Each

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


Dim axi As Axis
For Each axi In ActiveDocument.Background.Chart.Axes()
	
Next axi

Count

Returns the number of objects in the collection.


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

Item

Returns a single Axis object from an Axes collection.

Item (Type, AxisGroup)


With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart.Axes.Item(xlCategory) 
 .HasTitle = True 
 .AxisTitle.Caption = "1994" 
 End With 
 End If 
End With

Arguments

The following argument is required

Type (XlAxisType) - One of the enumeration values that specifies the axis type.

Possible return values are xlCategory - Axis displays categories, xlSeriesAxis - Axis displays data series, xlValue - Axis displays values.

Optional arguments

The following argument is optional

AxisGroup (XlAxisGroup) - One of the enumeration values that specifies the axis.

Possible return values are xlPrimary - The primary axis group, xlSecondary - The secondary axis group.