none
Updating Shared and or Public calendars RRS feed

  • Question

  • I have been doing some testing using COM to control Outlook via our third party application

    I can see and update a shared Office calendar as when I call PickFolder it shows at the bottom of the tree under Public folders and also under Favourites

    I'm guessing this calendar will be in a public folder on our Exchange server (out of my pay grade) ?

    If however I give permission for another user to update my own calendar or me theirs they do not appear in the PickFolder list

    Is it only possible to update public calendars (or your own) via COM or if you can update someone elses 'private' calendar that they have given you permission to how do you get that to appear in the PickFolder tree ?

    Thanks

    Wednesday, October 9, 2019 3:34 PM

All replies

  • Hello,

    You can use the NameSpace.GetSharedDefaultFolder method which returns a Folder object that represents the specified default folder for the specified user.

    Sub ResolveName()  
     Dim myNamespace As Outlook.NameSpace  
     Dim myRecipient As Outlook.Recipient  
     Dim CalendarFolder As Outlook.Folder  
     
     Set myNamespace = Application.GetNamespace("MAPI")  
     Set myRecipient = myNamespace.CreateRecipient("Eugene Astafiev") 
     myRecipient.Resolve  
     If myRecipient.Resolved Then  
     Call ShowCalendar(myNamespace, myRecipient)  
     End If  
    End Sub  
     
    Sub ShowCalendar(myNamespace, myRecipient)  
     Dim CalendarFolder As Outlook.Folder 
     Set CalendarFolder = myNamespace.GetSharedDefaultFolder(myRecipient, olFolderCalendar)  
     CalendarFolder.Display  
    End Sub


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Wednesday, October 9, 2019 4:18 PM
  • Thanks Eugene

    I've tried a quick test and that seems to work as you describe

    In terms of knowing which peoples calendars I have the ability to be able to write appointments to (ie they have given me permission) if I enumerate through the Outlook users (contacts?) is there anything that will tell me ?

    Thanks

    Thursday, October 10, 2019 8:54 AM
  • OK I've moved on a bit and can see I need to enumerate the global address list

    However in terms of permissions it this correct

    If I get this value http://schemas.microsoft.com/mapi/proptag/0x0FF40003 from the property assessor of the folder ...

    If it is my calendar folder I get 63

    If it is another users calendar folder I have permission to write to I get 18

    If it is another users calendar folder I DON'T have permission to, trying to get this property raises an error

    The property "http://schemas.microsoft.com/mapi/proptag/0x0FF40003" is unknown or cannot be found.

    Is that expected behaviour, am I looking at the right thing ?

    It is a bit of a pain in the last case that it does not return zero rather than raising an error. Is there anything I should be testing first or should I be looking at something else ?

    Thanks

    Thursday, October 10, 2019 9:33 AM
  • Try to use MFCMAPI for exploring available properties and their values. Another alternative is OutlookSpy.

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Friday, October 11, 2019 12:20 PM