Answered by:
DisplayName of shared calendar will not resolve

Question
-
I am trying to get a reference to a shared folder in order to do some work on it. I am working with Office 2016. I created a new user on the web app Outlook of Office 365 and shared the calendar with myself. From my desktop Office 2016 I can read and write to the shared calendar in the Outlook interface. I want to get a reference to the shared calendar in order to work with it in code. I am sure the code below worked previously but when testing today with the new shared calendar it keeps returning null.
Microsoft.Office.Interop.Outlook.NameSpace oNS = Info.OutlookApplication.GetNamespace("MAPI"); oRecipient = oNS.CreateRecipient(displayName); oRecipient.Resolve(); if (oRecipient.Resolved) return oRecipient; else return null;
Have I missed something? Is there a time lag after adding a new user before their email address is resolvable?
Mike VE
Thursday, September 28, 2017 4:12 PM
Answers
-
It can take EX provider up to 24 hours to sync GAL.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!- Edited by Dmitry Streblechenko _MVP_MVP Thursday, September 28, 2017 4:50 PM
- Marked as answer by Mike VE Thursday, September 28, 2017 4:51 PM
Thursday, September 28, 2017 4:50 PM
All replies
-
What is the value of displayName? What happens if you type/paste the same value into the To edit box in Outlook and hit Ctrl+K?
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!Thursday, September 28, 2017 4:18 PM -
The display name is Wayne Slouch. When I do as you suggest the Check Names dialog replies "Microsoft Outlook does not recognize Wayne Slouch.
When I added the user of that name in Office 365 I did not add him to my address book on the desptop machine. Is that necessary?
Mike VE
Thursday, September 28, 2017 4:32 PM -
Can you see that user in GAL when you open the address book (Ctrl+Shift+B)?
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!Thursday, September 28, 2017 4:35 PM -
I did Ctrl+Shift+B and the Offline Global Address book was shown. I switched to show the (online)GAL and Wayne Slouch was there. I switched back to the Offline GAL and he was now there. I then ran my code and it resolved correctly.
Is there anything I can do in code to cope with this - something like Refresh offline GAL?
If not I'll just have to cover it in the users' help notes.
Mike VE
Thursday, September 28, 2017 4:48 PM -
It can take EX provider up to 24 hours to sync GAL.
Dmitry Streblechenko (MVP) http://www.dimastr.com/redemption
Redemption - what the Outlook
Object Model should have been
Version 5.5 is now available!- Edited by Dmitry Streblechenko _MVP_MVP Thursday, September 28, 2017 4:50 PM
- Marked as answer by Mike VE Thursday, September 28, 2017 4:51 PM
Thursday, September 28, 2017 4:50 PM -
So basically my code works fine. I and my users just need to be aware of the up to 24 hrs delay.
Thanks for your help Dmitry.
Mike VE
Thursday, September 28, 2017 4:52 PM