switch on 'snap to' from vba

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone out there know how to switch on the 'snap to grid' - drawing tools - using VBA? When I record a macro no code appears for this. I've tried 'msoSnapToGrid' etc etc.
 
Sub Macro4()
Dim btn As CommandBarButton
Set btn = CommandBars("Drawing").FindControl(ID:=549, Recursive:=True)
btn.Execute
End Sub

--
Regards,
Tom Ogilvy

jngi said:
Does anyone out there know how to switch on the 'snap to grid' - drawing
tools - using VBA? When I record a macro no code appears for this. I've
tried 'msoSnapToGrid' etc etc.
 
I knew it was done through the CommandBars object, but it's so far down in the menu tree that it took some digging to find ...

Set cb = CommandBars("Drawing").Controls(1).CommandBar.Controls(5)_
.CommandBar.Controls(1)
if Not (cb.State = msoButtonDown) Then cb.Execute

Tom Lavedas
===========
 
I knew it was done through the CommandBars object, but it's so far down in the menu tree that it took some digging to find ...

Set cb = CommandBars("Drawing").Controls(1).CommandBar.Controls(5)_
.CommandBar.Controls(1)
if Not (cb.State = msoButtonDown) Then cb.Execute

Tom Lavedas
===========
 

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

Back
Top