VBA For PowerPoint "Snap to Other Objects"

D

Dave Jenkins

[First of all, in PowerPoint 2003, if I record a macro and turn "Snap to
grid" on/off, the recorded macro is devoid of code - what's up with that?]

It appears that the Presentation OM has a property "SnapToGrid" which can be
used to set snapping on/off in both 2003 and 2007. I can't find, however, a
way (from VBA) to set "Snap objects to other objects" on/off. Is there a way
to do this?

Thanks.
 
S

Shyam Pillai

Dave,
This is not available from the OM.
For 2003 you can use the following:

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

Likewise you take a similar approach for PPT 2007 for the ribbon.

Regards,
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top