Avatar of Bryce Bassett
Bryce Bassett
Flag for United States of America asked on

VBA - How to retrieve current dropdown setting in custom MS Office Ribbon menu

Working in Microsoft PowerPoint 2010, I have a custom ribbon menu (toolbar), and I'm using dropdown controls.  I want the user to be able to select a search keyword, which they narrows down the graphics that appear on a dropdown gallery in the button next to it.

Currently I have an onAction macro associated with the dropdown that changes a public variable each time the dropdown is changed.  then the gallery button filters based on that public variable.  How do I accomplish this without relying on a public variable?.  In other words, when the user hits the gallery button, I'd like it to read the current setting of the ribbon dropdown and create the filtered set at that time.  

Appreciate any pointers.
VBAMicrosoft OfficeMicrosoft Word

Avatar of undefined
Last Comment
DrTribos

8/22/2022 - Mon
John Wilson

You need to post both the XML code and the vba callback.
ASKER CERTIFIED SOLUTION
DrTribos

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
DrTribos

Oh... if using MS Word... definitely use a document variable to store the ribbon pointer handle as per Rory solution if you're not already doing that (that by the way is not quite related to the original question but well worth the effort).
Bryce Bassett

ASKER
Thanks!  Seems similar to the public variable solution I am using, but I'll try your suggestion.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
DrTribos

Doc variable is non volatile, that'd be the main difference