Making a custom Outlook ribbon group appear in another inspector – bugged?

For a small assignment for a client, I’ve created this custom ribbon for Outlook, which holds a new group with a couple of custom controls relevant for a new mail message. They’d like to add a couple of extra MIME headers if any of the recipients is outside their domain. So far, this was relatively easy to do (still, I find the documentation about Outlook and VSTO a bit scarce, required quite the amount of Googling). However, since meeting requests can also have external recipients, the custom ribbon group should appear there as well.

Luckily, I found a blog post on a very good blog which explains how to do this. The post can be found here.

So, I’ve followed the instructions there, created an event handler for the New Inspector event and built in a check to see if the new item is an meeting item. If so, set the OfficeId to “NewAppointment”.

This generally seems to work, except when you open new items in a specific order. Then all of a sudden the custom group doesn’t show up in the new meeting form anymore.

Following these steps seems to work just fine:

  • Debug the application
  • Compose a new meeting (the custom group appears)
  • Compose a new mail message (the custom group appears)
  • Compose a new meeting item again (the custom group appears)

However, when I change the steps to the following, the custom group doesn’t appear anymore in a new meeting:

  • Debug the application
  • Compose a new mail message (the custom group appears)
  • Compose a new meeting item (now all of a sudden the group doesn’t show up anymore!)

I can’t really find out why it doesn’t work. When adding a breakpoint to the Load event of the Ribbon, I did found out that for some reason the Load event doesn’t fire anymore for a meeting in scenario #2. It works just fine if I follow the procedure in scenario #1 however.

The way I’ve currently solved it is by creating a duplicate of the ribbon and setting the OfficeId to “NewAppointment”. Obviously, this doesn’t deserve any prizes for elegance, but for now it does the trick…

I’ll be sure to write an update to this post should I find out how to deal with this weird issue.