Application.SnapToGuides property (Publisher)

True for Microsoft Publisher to use the guides to align objects on a page in a publication. Read/write Boolean.

Syntax

expression.SnapToGuides

expression A variable that represents an Application object.

Return value

Boolean

Example

This example adds horizontal and vertical ruler guides every half inch on the first page and then sets the options to align objects on the page to the guides.

Sub SetSnapOptions() 
 Dim intCount As Integer 
 Dim intPos As Integer 
 With ActiveDocument.Pages(1).RulerGuides 
 For intCount = 1 To 16 
 intPos = intPos + 36 
 .Add Position:=intPos, Type:=pbRulerGuideTypeVertical 
 Next 
 intPos = 0 
 For intCount = 1 To 21 
 intPos = intPos + 36 
 .Add Position:=intPos, Type:=pbRulerGuideTypeHorizontal 
 Next 
 End With 
 With Application 
 .SnapToGuides = True 
 .SnapToObjects = True 
 End With 
End Sub

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.