Class Gridlines (Word VBA)

The class Gridlines represents major or minor gridlines on a chart axis. 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

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

GetProperty (ID)

Name

Returns the name of the object.


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

Select

Selects the object.


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

SetProperty

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