SnapToGrid Property

Microsoft PowerPoint Visual Basic

Show All

SnapToGrid Property

       

MsoTrue to snap shapes to the grid lines in the specified presentation. Read/write MsoTriState.

MsoTriState can be one of these MsoTriState constants.
msoCTrue
msoFalse
msoTriStateMixed
msoTriStateToggle
msoTrue

expression.SnapToGrid

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

This example toggles snapping shapes to the grid lines in the active presentation.


Sub ToggleSnapToGrid()
    With ActivePresentation
        If .SnapToGrid = msoTrue Then
            .SnapToGrid = msoFalse
        Else
            .SnapToGrid = msoTrue
        End If
    End With
End Sub