VSTO Outlook 2016 using IRibbonExtensibility and dynamicMenu: Custom DropDown Menu does not open in certain cases - outlook

In our VSTO Outlook AddIn we have a DropDownMenu that does not open on the devices of two customers. Both use Outlook 2016 32-Bit. They have been reporting this for a few months now. Before they had not experienced this problem.
When the customers try to open it it looks like this:
The DropDownMenu is implemented using IRibbonExtensibility and dynamicMenu like this in ribbon id Microsoft.Outlook.Mail.Compose:
<?xml version="1.0" encoding="utf-8"?>
<customUI onLoad="Ribbon_Load" xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabNewMailMessage">
<group insertBeforeMso="GroupClipboard"
id="MyGroup"
label="Simba"
getVisible="IsAdvancedOutlookItemVisible" >
<dynamicMenu id="MyMenu"
size="large"
imageMso="AttachFile"
getLabel="GetLabel"
getContent="GetMenuContent"
getEnabled="IsEnabled"
invalidateContentOnDrop="true"
/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
We can not reproduce it inhouse.
We have found out that the GetMenuContent method is not called in these cases.
An interesting thing is that one customer reported that it happens only on a certain monitor. If he opens Outlook on another monitor the DropDownMenu is shown.
Maybe a bug in Outlook or do you have an idea what could go wrong here?

Your ribbon XML looks good, I don't see anything strange here. Make sure that the GroupClipboard tab exists on the UI. Also you may check whether other callbacks are invoked by the Office and no exceptions were thrown there prior to the GetMenuContent callback.
Note, if a VSTO add-in attempts to manipulate the Microsoft Office user interface (UI) and fails, no error message is displayed. However, you can configure Microsoft Office applications to display messages for errors that relate to the UI. You can use these messages to help determine why a custom ribbon does not appear, or why a ribbon appears but no controls appear. Read more about that in the How to: Show Add-in user interface errors article.

Finally I found the reason for this behavior:
Actually as #Eugene guessed at the customer's system there is an exception thrown that is shown if outlook is configured to display the error messages. It told me that there is an illegal character in the xml content GetMenuContent() returned.
I ran into the pifall since I directly built up the xml string and did not use something like XDocument. So there were illegal characters in the xml like ampersand that were not escaped.
I could not find it earlier since the xml content was built up dynamically and only in rare cases customers had such illegal characters.

Related

How can I add the Text Highlight Color control to a custom xml ribbon in PowerPoint?

I'm building a custom ribbon in PowerPoint and would like to include the Text Highlight Color Picker control on it. I've found an idMso called TextHighlightColorPicker, but it's not recognised by PowerPoint so I just get an error when I open it.
<control idMso="TextHighlightColorPicker" size="large" label=" " />
I've tried various other idMso with the word 'highlight' in but to no avail. I imagine it's simply not available for custom ribbons, but I thought I check to see if anyone knows, because it's seems strange that most of the other buttons are available but not that one.
Thanks in advance!
There is no such command available in PowerPoint 2016. You can find the list of commands available if you navigate to the Customize Ribbon on PowerPoint settings dialog:
Here you can find the list of all available controls. And if you hover the mouse over any entry you may find the idMso value which can be used in the code for building a custom UI.
I eventually found the idMso as per the instructions in Eugene Astafiev's answer, it turns out it is only avaiable in subscription versions. The id is "TextHighlightColorPickerLicense".

How to show outlook add-in in the main pane instead of compose and read context

It's my first time developing add in for outlook, i'm tryng to do an add-in that interact with outlook calendar to find an appointment, but i can only show up the add-in when i create new appointment, is there any way to show it outside compose and read context? like viva insights do?
i found that this can be done with VSTO, but i need it to work also with web outlook and other os, if someone can help me to figure it out i will apreciate.
i tried to do it following the add-in doc
https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/outlook-add-ins-overview#extension-points
i can't find an extension point that fits my purpose.
Thank you
Add-ins are only valid in Mail/Calendar individual item context currently. Hence, if no item (email / event) is selected, addins do not show-up or work - it does not know in which context it is suppose to run.
If your scenario requires it to run without email/event context, we suggest you to file a feature request here: https://aka.ms/M365dev-suggestions

Outlook Add-in Event On-open email

I've been trying to activate my add-in when the user open his email so I can analyze it. I found one example in on add-in from another company (Retruster). The issue I didn't found way to reproduce the action. Someone knows how to reproduce this event? Because I just found when sending a message.
The labels shown on the YouTube video are categories set on emails. They can be set on the Exchange server side when your message arrives without any add-in involved. Remember, add-in activation rules are described in the manifest file - it can be regex filters, known entities etc. Read more about them in the Activation rules for contextual Outlook add-ins article.
The add-in starts working when the user clicks on the ribbon button.

How to make Outlook Add-in open in the side pane

I developing an outlook add-in for Office 365 and currently showing it in the grey bar below a mail item's details. So when clicking on the add-in name, I get a pane below it like this:
However, I want it to display it like Trello in the side pane like this:
Is there any specific setting in the add-in manifest that I need to include to get it to work like the Trello add-in?
You would need to use "VersionOverrides" tag for your manifest. Inside this section you would use...
<ExtensionPoint xsi:type="MessageReadCommandSurface">
and for the action you would "ShowTaskPane" with the resource pointed to the HTML file you would like to load. The example of such manifest you may find at GitHub for OfficeDev team

Outlook Object Model - Hooking to the Conversation Cleanup Feature

Outlook 2010 has a feature called Convesation Cleanup. This feature is implemented using the Conversation Header Outlook Object Model.
I would like to hook to this call and perform an action when triggered, yet I can't figure out how to catch it/hook on to it. Is anyone aware if this is possible? If its not, are you aware of any way around it? I have tried using outlook spy to view the event log when executing 'conversation cleanup' with no luck (nothing logged)... is there anyway of viewing deeper tracing of outlook events?
It turns out to be quite simple. The initial step is to obtain the idMso of the desired button to override. Microsoft provides a list of all the control ids for the Office suite however I found faster and more user friendly way of obtaining the idMso.
Office Button/File -> Options -> Customize Ribbon -> Hover mouse on
desired command - idMso is displayed in brackets
Once we have the desired ids, we edit the Ribbon.xml by adding a set of commands to override the onAction/Enable settings of the button. See example bellow;
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<commands>
<command idMso="IgnoreConversation" onAction ="FooRoutine" enabled="true"/>
</commands>
<ribbon>
</ribbon>
</customUI>
Last, we create the desired function on the Ribbon.vb which will be executed once the button is pressed.
I strongly suggest that you watch the 8 minute MSDN video where the steps above have been very well explained.

Resources