Class Gridlines (Word VBA)

The class Gridlines represents major or minor gridlines on a chart axis.

Set

To use a Gridlines class variable it first needs to be instantiated, for example

Dim grds as Gridlines
Set grds = ActiveDocument.Background.Chart.Axes(1).MajorGridlines

The following procedures can be used to set variables of type Gridlines: Axis.MajorGridlines and Axis.MinorGridlines

Border

Returns the border of the object.

Dim cbrBorder As ChartBorder
Set cbrBorder = ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Border

Delete

Deletes the object.

ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Delete

Format

Returns the line, fill, and effect formatting for the object.

Dim cftFormatted As ChartFormat
Set cftFormatted = ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Format

GetProperty

Syntax : expression.GetProperty (ID)

Name

Returns the name of the object.

Dim strName As String
strName = ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Name

Parent

Returns the parent for the specified object. Read-only object.

Dim objParent As Object
Set objParent = ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Parent

Select

Selects the object.

ActiveDocument.Background.Chart.Axes(1).MajorGridlines.Select

SetProperty

Syntax : expression.SetProperty (ID, Value)

Dim strID As String: strID =  
ActiveDocument.Background.Chart.Axes(1).MajorGridlines.SetProperty ID:=strID, Value:=

Arguments

The following arguments are required:

ID - String

Value