Hi, I'm using a code to hide Deleted items folder which let me hide any selected folder even if it's in a delegate mailbox but to make the folder visible again since I cannot select it I have to use Session.GetDefaultFolder(3) where number 3 represent the Deleted items folder (OIDefaultFolders) which mean currently whenever I need to show folder on delegate mailbox I would have to close outlook and launch using a different profile.
Since I updated to windows 11 my Outlook is always loading the first profile created even if I say to load another one, launching as admin doesn't resolve it so I would like to change the code so it can either target a mailbox written in code or selected instead of main mailbox.
Here's my current code:
Thank you, Simon
Since I updated to windows 11 my Outlook is always loading the first profile created even if I say to load another one, launching as admin doesn't resolve it so I would like to change the code so it can either target a mailbox written in code or selected instead of main mailbox.
Here's my current code:
Code:
Public Sub ShowFolder3()
Dim oFolder As Outlook.Folder
Dim oPA As Outlook.PropertyAccessor
Dim PropName, Value, FolderType As String
PropName = "http://schemas.microsoft.com/mapi/proptag/0x10F4000B"
Value = False
Set oFolder = Session.GetDefaultFolder(3)
Set oPA = oFolder.PropertyAccessor
oPA.SetProperty PropName, Value
Set oFolder = Nothing
Set oPA = Nothing
End Sub
Thank you, Simon