If you are following the latest updates the the OfficeJS API’s, you will see that PowerPoint, Excel and Word have this new feature that allows you to specify an equivalent COM add-in in place of the Web Add-in. Here is the link: https://docs.microsoft.com/en-us/office/dev/add-ins/develop/make-office-add-in-compatible-with-existing-com-add-in
This is useful for when you have created a Web Add-in but it is not as feature rich as your COM add-in. So on the Windows clients, you still want your COM (or VSTO) solution to run there and not the web version of the add-in.
However, this feature has not yet arrived for Outlook. I am told that this is coming, but for now there really are only two workarounds.
If you are using Office 2016, you can set your manifest requirements to 1.5, like this:
<Requirements><bt:Sets DefaultMinVersion=”1.5″><bt:Set Name=”Mailbox” /></bt:Sets></Requirements>
If you are needing to support Outlook 2019 or Outlook for Office 365, then this easy trick will not work. So what you need to do is a bit more complicated. To start you need to collect some information first:
- Open Outlook, and verify that your web add-in customization has loaded.
- Go to File, Options, Customize Ribbon:
- At the bottom, click Import/Export and select Export all customizations.
- Save the “customui” file to the desktop and then open it in Notepad.
- You will look for your customization and it will be in a group or a tab and contain an if like this: x1:Group_5febe0ec-e536-4275-bd02-66818bf9e191_msgEditGroup_TabNewMailMessage.
- Make note of this value, minus the namespace (x1:) and whether it is a customtab or a customgroup.
If this does not work for you a couple of other options are to add the Group to the Quick Access bar, by right-clicking on the group and selecting “Add to Quick Access.” This should help it appear in the customUI file. However, if this still does not work, you can make an “educated guess” at the name by using these steps:
- Open your manifest file in your Web Add-in and locate the ID:
- Next, locate what you called the group in your manifest:
< Group id=”msgEditGroup” >
- Finally, you need to determine which “Ribbon” it is on. This is a tad more complex, but since most following the “TabDefault” option, here are two defaults I know about, that could help you:
- From there you can build the Group identifier:
- If you are working with a custom tab, you would look in your manifest and get the name of the custom tab:
- From there you can build your tab identifier:
The namespace is what makes this whole process a little harder than expected. This namespace is a UID for the Exchange Account to which the add-in was installed. And this ID is unique to every user and each email account in Outlook. What you will need to do is customize the Ribbon XML in your solution to then hide this group. I have created a solution here on github that shows how to do this end-to-end with a new add-in:
The primary functionality is found in the GetCustomUI function. Here is the function:
What this does is loads a file called RemovedCustomizations.txt from the install directory of the add-in. This file will contain entries like this:
Important to note, the first entry is the ID of your Web Add-in. This is used to create the namespace entry,
You will use the steps above, to build this list. This is a tad more complex than I had hoped it would be, so please let me know if you get stuck on any parts and/or if there are areas that you think I can elaborate more.