0

We have a VSTO add-in for Outlook, that supports booking of resources managed by our cloud system. In addition we support resources that are also available in Exchange as rooms to support integration with other systems.

When we perform a booking of such a room, the add-in adds the corresponding Exchange email address for the room to recipients, so it will also be booked in Exchange.

This used to work fine, but now we have received a report from a customer that they can no longer create bookings for resources with Exchange integration. The error they receive is completely unhelpful:

System.ArgumentException: Der gik desværre noget galt. Du kan prøve igen.
   ved Microsoft.Office.Interop.Outlook._AppointmentItem.Save()

(in English: "Something went wrong. You can try again")

This happens when add-in attempts to save the item after adding some custom properties. I think the error is triggered by the add-in adding the Exchange rooms to recipients, since it does not happen for resources without Exchange integration.

Here is the code we use to add recipients:

var rec = ...;  // custom DTO with recipient info
string recipientInfo = string.IsNullOrEmpty(rec.Email) 
                       ? rec.OutlookName 
                       : rec.Email;

var recRecip = appointment.Recipients.Add(recipientInfo);
recRecip.Type = rec.RecipientType;

if (Current.Settings.IsEnabled(FeatureFlag.ResolveAddedRecipients))
{
     using (LogHelper.TimedTask($"resolving recipient [{rec}]", Log))
     {
          recRecip.Resolve();
     }
}

I can see from the logs, that the room recipient has email address, so above code will add by email. Also, the feature flag to resolve recipients is enabled, so the code will call resolve afterwards.

What could be going wrong here?

EDIT: Their Outlook version is 16.0.0.5071.

rchrd
  • 379
  • 2
  • 6
  • 17
Søren Boisen
  • 1,669
  • 22
  • 41
  • Where does the `AppointmentItem` come from? Do you modify and save the appointment immediately after Outlook saves it? – Dmitry Streblechenko Dec 16 '20 at 19:51
  • @DmitryStreblechenko The AppointmentItem comes from Explorer object. The user uses our add-in to perform booking while creating or editing a meeting in Outlook. The error happens before the user saves and sends the meeting request. – Søren Boisen Dec 18 '20 at 00:37
  • Are you working with a single instance or appointment or an instance of a recurring appointment? – Dmitry Streblechenko Dec 18 '20 at 05:16
  • @DmitryStreblechenko Sorry for the late reply, Christmas holidays and all that. It is a single appointment (meeting to be precise), not an instance of a recurring appointment. – Søren Boisen Jan 11 '21 at 14:51

1 Answers1

1

If the problem is isolated to the user's computer, we always recommend our IT staff to share the O365 Outlook Diagnostics Tool which analyses the outlook install, data files, plugins, cache and performs checks to identify source of issues on client computers.

  • The customer reported back, that the problem was solved by removing the Outlook profile and create a new one. So it was indeed a local problem with that installation and nothing to do with our add-in. Thanks! – Søren Boisen Mar 05 '21 at 16:16