05-10-18 11:50 AM
Answered! Go to Answer.
15-05-20 03:20 PM
I've been looking into this. Sometime within the last 12 months, there was a security fix applied which actively prevents this functionality from working on a shared mailbox. The code was previously tested on a non-o365 envrionment, so I'm wondering if that has something to do with it.
Google led me to a post confirming that the code in the VBO is what was previously valid, so it's not technically a syntax error.
I did find one work around, but it's a hack and a two-step solution. Do note that this will not take into account any value supplied for the subfolder variable, but does require that some value be present in order to trigger. The end result will pull from whatever the current active folder is, which somehow doesn't trip any security flags. I looked into setting the folder as the current active folder by code, but that uses the same code snippet that's currently running into issues.
Step 1:
Modify the Sub_Folder section of the code
If Sub_Folder <> "" Then if sharedEmail <> Nothing then folder = app.ActiveExplorer.CurrentFolder else For each name as string in Sub_Folder.Split("\") folder = folder.Folders(name) Next end if End If
Step 2:
Have a separate VBO attach to Outlook and click the subfolder that you want to access.
10-10-18 02:05 AM
10-10-18 06:51 AM
10-10-18 10:37 AM
12-10-18 05:22 AM
13-10-18 01:22 AM
16-11-18 10:55 PM
17-11-18 12:27 AM
I've had time to dissect this VBO a bit more, and was able to rewrite my own handler based on some of the streamlining in this one. By default, it will pull for all attached inboxes on the default profile. You could probably apply a filter string to set the recipient address. Alternatively, you can make modifications to the actions to account for a profile and/or shared inbox.
Profile and sharedEmail should be of type Text. Place this right after the namespace declaration and modify the code/start stage inputs accordingly. sharedEmail should be the address of the attached inbox, whereas Profile should match the label of your Outlook profile if it's intended for anything other than the default.
Dim olSharedRecip as object if Profile <> "" then _nameSpace.Logon(Profile, , True, True) end if if sharedEmail <> Nothing then olSharedRecip = _nameSpace.CreateRecipient(sharedEmail) folder = _nameSpace.GetSharedDefaultFolder(olSharedRecip, Outlook_Folder_ID) end if
19-11-18 10:05 AM
19-11-18 09:35 PM