Which Button Was Clicked on the Ribbonbar Menu

Ninja Coder

New Member
Outlook version
Outlook 2019 64-bit
Email Account
Exchange Server
I am developing in 64-bit Outlook 365 version 1908 desktop application:
1592854118746.png


I currently have three customized ribbonbar menu buttons in my custom tab group. I am not using any custom forms. Is there a way I can use VBA to detect which of my custom ribbonbar button was clicked using a VBA macro?

1592853898675.png
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Typically, the macro linked to the button would be different for each. It can be linked to a macro that just sets a variable then calls a macro all 3 buttons share.

dim cityName as string
sub austinbt()
cityName = "Austin"
call othermacro
end sub

sub othermacro ()
msgbox cityname
end su
 

Ninja Coder

New Member
Outlook version
Outlook 2019 64-bit
Email Account
Exchange Server
Typically, the macro linked to the button would be different for each. It can be linked to a macro that just sets a variable then calls a macro all 3 buttons share.

dim cityName as string
sub austinbt()
cityName = "Austin"
call othermacro
end sub

sub othermacro ()
msgbox cityname
end su
Hi Diane,
Thanks for the quick response. We've already tried this approach, but the "powers that be" would like some way to track which button was clicked on the ribbonbar menu. Is there a way in VBA I can access the properties of the buttons on the ribbonbar?
 
Thread starter Similar threads Forum Replies Date
E Can't accept or decline task (no button appears) Using Outlook 4
M VbScript for Command Button on Contacts Custom Form Using Outlook 1
Q Prompt button to auto turn on Out of Office Outlook VBA and Custom Forms 3
C iCloud Setting missing Outlook tab and Outlook missing the iCloud refresh button Using Outlook 4
witzker Outlook 2010 Insert Date & Time at the button of an OL contactform in red Using Outlook 2
S How to set up button in ribbon for individual Quick Steps Using Outlook 1
C Custom Outlook Form - Populate Information from Radio Button / Check Box Using Outlook 0
J Command Button to stamp a date and time in a textbox in Outlook 2016 Outlook VBA and Custom Forms 3
A ScanPST finding errors but no Repair button Using Outlook 2
N Creating a button or link to a form in the Organizational Forms Library Outlook VBA and Custom Forms 3
J Execute Add-In Button from VBA Outlook 2016 Outlook VBA and Custom Forms 1
D Command Button code will not execute. Any suggestions Please. Outlook VBA and Custom Forms 2
S Reminder Dialog Open Button Using Outlook 2
Wayne Dardis Calling Ribbon Button in Outlook 2016 Outlook VBA and Custom Forms 6
Tanja Östrand Outlook 2016 - Create Macro button to add text in Subject Outlook VBA and Custom Forms 1
R Categorize Button in Quick Access Toolbar Disappears on New Email Using Outlook 1
S Problem running Command button code Outlook VBA and Custom Forms 2
E Button to change subject Outlook VBA and Custom Forms 1
S Shortcut/button to a Calendar Group Using Outlook 0
soadfan Enable all rules from toolbar button? Outlook VBA and Custom Forms 3
I Creating meeting invite with disabled tentative button Outlook VBA and Custom Forms 5
Diane Poremsky Contacts are missing when you click the To button New Slipstick.com Articles 0
T Unable to 'Upload a file' using popup 'Browse' button Using Outlook 0
makinmyway ScanPST.exe Missing Repair Button Using Outlook 15
williamlambton Reinstate "Open" button on mail item right-click context menu. Outlook Wishlist 2
K Remove Manage APPS button for users Exchange Server Administration 1
J Send and Receive Button - only check default account? Using Outlook 1
A custom send button Outlook VBA and Custom Forms 3
P Possibility to create a calendar button "remaining week"??? Using Outlook 3
E Outlook 2007: Problem with "Move to Folder >" button on toolbar Using Outlook 6
E Button in body of email to approve/reject with original text Using Outlook 1
H Preventing the Send button from being clicked on an Outlook Form Outlook VBA and Custom Forms 1
S Create a custom "Send" Button Outlook VBA and Custom Forms 3
makinmyway Can I add a Map It Button to Custom Contact Form? How? Outlook VBA and Custom Forms 6
R How can I retain embedded object with voting button reply? Using Outlook 5
G Moving "Delete" button on Outlook for Mac Using Outlook 1
K OL2010 Button to Insert First Name Outlook VBA and Custom Forms 6
K OL2010 Button to Insert First Name Using Outlook 1
R Outlook 2013 People Pane - Where is the "Add" button for social networks? Using Outlook 4
C Button to Forward and Move Using Outlook 4
A delete button on message list disappeared Using Outlook 19
M button to send and print emails Using Outlook 26
V Macro for 'Back' button Using Outlook 17
S Code behind form command button Using Outlook 2
C Contacts Button on Custom Form Using Outlook 1
J Custom Contacts: Linking button to website Using Outlook 4
J Outlook 2003 freezing when clicking on TO button Using Outlook 2
M Open new outlook form from within existing outlook form using command button Using Outlook 4
A outlook 2013 people hub :: phone button Using Outlook 1
Commodore Button for Send/Received for a specific account Using Outlook 4
Similar threads


















































Top