PDA

View Full Version : Solved: Snap-to-Grid vs. Snap-to-Shape



TrippyTom
12-09-2008, 03:59 PM
Hi gang,

If you've ever wanted to turn OFF the snap-to-grid and turn ON snap-to-shape via code, here's how:
'turn SnapToGrid off
ActivePresentation.SnapToGrid = msoFalse

'turn SnapToShape on
Dim oCmd As CommandBarButton
'Retrive the menu command for Snap to Shape
Set oCmd = CommandBars.FindControl(Id:=1402)
' If it's off then activate it
If oCmd.State <> msoButtonDown Then
oCmd.Execute
End If

As I was researching this for myself, this site helped:
http://www.eggheadcafe.com/software/aspnet/33512485/vba-for-powerpoint-snap.aspx