Søren Boisen
Søren Boisen

Reputation: 1706

Outlook VSTO error when saving appointment item

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.

Upvotes: 0

Views: 147

Answers (1)

user13025316
user13025316

Reputation:

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.

Upvotes: 1

Related Questions