0

I wrote a VSTO add-in for outlook. I am in a Microsoft Exchange environment in my company. I use the RDOOutOfOfficeAssistant object to set an OOF message (StartTime, OutOfOfficeTextInternal, ...). Everything works fine on my PC with MS Outlook 2013 32-bit. When I deploy the add-in to MS Outlook 365 MSO 32-bit machines, the part that uses the RDOOutOfOfficeAssistant object doesn't work. When I monitor the program part with a (Visual Basic) Try - Catch, I get an error message "EWS is not available: HTTP error 401 from https://outlook.office365.com/EWS/Exchange.asmx".

I'm unsure if I need the Session.Credentials.Add ... line from the example

set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
Session.Credentials.Add "*.myserver.com", "Domain\UserName", "MyPassword"
set OofAssistant = Session.Stores.DefaultStore.OutOfOfficeAssistant
OofAssistant.BeginUpdate

at https://dimastr.com/redemption/RDOOutOfOfficeAssistant.htm. I commented it out for now. Do I have to enter the login data of the currently logged in user here? How do I do that if I distribute the one add-in to over 100 users. Every user has different login data?!?

I would expect the add-in to work on Outlook 365 as well. So it works on outlook 2013, I think, EWS is available on the exchange server.

adi63
  • 17
  • 4

1 Answers1

0

Office 365 no longer uses basic authentication, and there is no easy way to generate OAuth tokens unless you register you app in Azure.

Redemption, when running inside the outlook.exe address space, can intercept and reuse OAuth tokens used by Outlook itself when it performs its own EWS calls.

Create an instance of the RDOSession object ahead of time (e.g., when your addin starts up) to give it time to cache the tokens and comment out the Session.Credentials.Add line when you later use the OutOfOfficeAssistant object.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Hi Dmitry, I took your hints into account ... unfortunately still didn't work. But I have now made an attempt with the current version of the DLL's. (I use the variant without registration by using RedemptionLoader). Lo and behold, to my surprise, OOF also works with Outlook 365. So far I have used the following versions of the DLL's: 5.21 The version I downloaded now and it worked with is Version: 6.2 Can I also make the project work with version 5.21? Or do we have to buy a new version now? (My boss will not be happy because we do not use it commercially, but only internal) – adi63 Nov 29 '22 at 18:19
  • I don't think version 5.21 intercepted the OAuth tokens, so I think you'd need one of the latest versions. We can give a 30% off upgrade discount - send an email to redemption (at) dimastr (dot) com, and I will email you the discount code. Thanks! – Dmitry Streblechenko Nov 29 '22 at 20:20