0
votes

can I create a sharable outlook folder and set sharing permissions in outlook vsto add-in?

1
Welcome to Stack Overflow! Please add more useful tags and more context on what you are trying to do, what steps you have tried in order to solve your problem (i.e. code), and where you got stuck. - Bernhard Stadler

1 Answers

1
votes

VSTO (nor the Outlook object model) doesn't provide anything for that. The best what you can do is create a public folder in Outlook.

And you may set folder permissions using a low-level API (Extended MAPI) or just using any third-party wrapper around that API such as Redemption. See Update Folder Permissions using VBA for more information.

Sub AddFolderPermissions()
Dim ParentFolder
Dim Folder
  Set mySession = CreateObject("Redemption.RDOSession")
  mySession.MAPIOBJECT = Application.Session.MAPIOBJECT

Set ParentFolder = mySession.PickFolder
  For i = 1 To ParentFolder.Folders.Count
  Debug.Print ParentFolder.Folders(i).Name
    Set Folder = ParentFolder.Folders(i)
      For Each ace In Folder.ACL
        Debug.Print ace.Name & " - " & ace.Rights
          If ace.Name <> "Bo Peep" Then
      ' Get Exchange user
          Set AddressEntry = mySession.AddressBook.GAL.ResolveName("Eugene")
          Set ace = Folder.ACL.Add(AddressEntry)
            ace.Rights = ROLE_AUTHOR
          End If
      Next
  Next
End Sub