Share via


DocumentBase.GridOriginFromMargin Property

Definition

Gets or sets a value that indicates whether Microsoft Office Word starts the character grid from the upper-left corner of the page.

public:
 property bool GridOriginFromMargin { bool get(); void set(bool value); };
public bool GridOriginFromMargin { get; set; }
member this.GridOriginFromMargin : bool with get, set
Public Property GridOriginFromMargin As Boolean

Property Value

true if Microsoft Office Word starts the character grid from the upper-left corner of the page; otherwise, false.

Examples

The following code example sets the horizontal and vertical point of origin for the grid, sets the horizontal and vertical distance between gridlines, and then enables the Snap objects to grid feature for the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentGridDistanceHorizontal()
{
    this.GridOriginHorizontal = 80;
    this.GridOriginVertical = 90;
    this.GridDistanceHorizontal = 9;
    this.GridDistanceVertical = 9;
    this.SnapToGrid = true;
    this.Application.Options.DisplayGridLines = true;
}
Private Sub DocumentGridDistanceHorizontal()
    Me.GridOriginHorizontal = 80
    Me.GridOriginVertical = 90
    Me.GridDistanceHorizontal = 9
    Me.GridDistanceVertical = 9
    Me.SnapToGrid = True
    Me.Application.Options.DisplayGridLines = True
End Sub 

Remarks

When GridOriginFromMargin is false, GridOriginHorizontal and GridOriginVertical are used.

Applies to