Hi all!
I have a few buttons with action coded on a module. I am wanting to create a toggle button to toggle on/off that series of buttons on the toolbar..
How would I do that?
Any advice/help most appreciated!
Best regards
Philippe
Hi all!
I have a few buttons with action coded on a module. I am wanting to create a toggle button to toggle on/off that series of buttons on the toolbar..
How would I do that?
Any advice/help most appreciated!
Best regards
Philippe
Try adding a uniwue tag when you make the button
Then you should (this is top of head) be able to sayWith .Add(Type:=msoControlButton) .Caption = "Move Down" .Style = msoButtonIcon .OnAction = "MoveDown" .FaceId = 3275 .Tag = "myUniqueTag" End With
Sub toggle() Dim cb As CommandBarButton Set cb = CommandBars.FindControl(Type:=msoControlButton, Tag:="myUniqueTag") cb.Visible = Not cb.Visible End Sub
John Wilson
Microsoft PowerPoint MVP
Amazing Free PowerPoint Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html
Loving this John! Thank you very much.
Is there a way I can position the button (Not the toggle, the other button). The reason I ask is, I would like to have the buttons showing below a command bar I already have.
Thank you for your expert advice!
Kind regards,
Philippe
You cannot position a button. You would need to have the button in a new commandbar and play with .Top .Left and .Position
John Wilson
Microsoft PowerPoint MVP
Amazing Free PowerPoint Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html
Thanks John! That makes sense... Is it a lot of rework to place that button in a command bar so I can position it? (Just wondering...)
Best regards and thanks again for the support!
Philippe
Hi John,
It seems as if the code only hides 1 single tagged object. If I have more than 1 tagged object as "myUniqueTag", it only hides 1 and ignore the others... Can you help?
Kind regards,
Philippe
Unique means unique. Create several unique tags.
John Wilson
Microsoft PowerPoint MVP
Amazing Free PowerPoint Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html
Thanks John! Makes total sense indeed, I thought there was a way to use one uniqe tag for a group of buttons.
Best regards,
Philippe