How to capture custom button click event in outlook from excel? - excel

I'm trying to control Outlook via Excel by VBA ofc.
My Excel code creates and XML that adds button to Message Ribbon.
The button's job is to save email to specific location given by Excel.
I cant run Excel macro from Outlook macro because you cant access VB Project of Outlook. It needs to be provided for couple of persons and this is hard to deploy and control. So I thought maybe I can capture click event of that button from excel. I've seen examples to capture Reply button but nothing else.
I'm looking for place in Outlook object where this information might be stored. And any help with that, different approaches are welcome as well.

It looks like you need to develop a COM add-in instead of VBA macro. First of all, you can't modify the Ribbon UI in Outlook from VBA macros as you do it in Excel. Second, VBA macros are not designed for distributing them on multiple machines. That is what COM add-ins were invented for. See Walkthrough: Create your first VSTO Add-in for Outlook to get started quickly.
The following articles provide instructions on how to create a custom ribbon UI:
Walkthrough: Create a custom tab by using the Ribbon Designer
Walkthrough: Create a custom tab by using Ribbon XML

Related

Open 'Insert Hyperlink' menu in Excel office Add-in

I want to open the 'Insert Hyperlink' menu programmatically without right clicking the cell.
https://stackoverflow.com/questions/48985342/open-insert-hyperlink-menu-in-excel-through-a-clickable-shape#:~:text=Application.Dialogs(xlDialogInsertHyperlink).Show
this link shows the way to achieve this in vba, is there a similar way for opening hyperlink menu in Excel office Add-in?
There is not yet an Office JS API similar to the Application.Dialogs API in VBA that can be used by an add-in to open Excel dialogs. Please consider logging a request for this API in the Microsoft 365 Developer Community.
An alternative might be to have the add-in provide UI similar to the Insert Hyperlink dialog either in the task pane or in a dialog.

Why doesn't my Shared Excel 365 sheet allow VBA buttons to work in the webpage version of the sheet?

My whole team uses Office 365. This is my first attempt using the online sharing 'co-authoring' feature in 365. I created a 5-6 person, team-use Excel spreadsheet as an ongoing check-off log for a common task. I put in VBA "Done" buttons for when a team member finishes a task.
The file is on our company's OneDrive online folder (which I read was a requirement for co-authoring to work), but when opened in a web-browser the macro buttons are disabled -see screenshot. The VBA button macros come back and work great only when a user clicks "Open in Desktop App" and works it directly from the app -see 2nd screenshot.
Is there a way for the macro buttons with their VBA code to work in the browser view of the spreadsheet?
Thanks for any suggestions!

Creating a button on Excel Ribbon to open Userform Window

I have developed a VBA userform interface that allows the user to input values, have it calculate results, and then print them out into the worksheet. I am wondering if there is any possible way that I can have a button on the excel ribbon, say under the "Data" tab for instance, that would elicit the userform interface to open.
Currently the only way I can use the interface is by Developer>>Visual Basic>>Clicking on Userform>>F5. This also limits the userform in that it can only be used in one particular workbook as opposed to many. Or if it was somehow possible, to make it an add-in instead.
Any help is greatly appreciated!
The easiest way to add custom tab and/or button to Ribbon is to use Custom UI Editor Tool for MS Office Ribbon. Follow the links provided in comments to your question too. There you'll find many useful information.

VBA control over the ribbon?

I am in the process of creating a VBA add-in for Excel 2010, and I used the "Custom UI Editor for Microsoft Office" tool to create my own ribbon.
However, I would like to give the user the option to load my add-in without displaying the ribbon, or with different parts of the ribbon visible.
With menus, I know you can completely control them programmatically, but ribbons seem to work differently.
Is there a way in VBA to not load my customUI.xml ribbon tabs on startup?
Is there a way to remove items from (or add items to) these tabs at runtime?
here is a whole slew of help on this subject Awesome Ribbon Help. I think points 2 and 3 are of particular interest to you.

Custom Menu visible to one document in Excel

I have created customized menu and toolbar in MS Excel. I wanted to show this menu and toolbar to specific document only. When I open any other xls file, it shows that menu and toolbar.
MS Excel 2003
How to do that using vba-excel macro or any other way to do that?
If you need more information, please ask me.
Thanks :)
OK - so this website will help you:
http://www.ozgrid.com/VBA/custom-menus.htm
It actually works in Excel 2007 also, but adds the menu under the Add-Ins tab.
You basically need to access the code for ThisWorkbook in the VBA application. From there, you can modify the Application.CommandBars object to do what you need.

Resources