cancel
Showing results for 
Search instead for 
Did you mean: 

Outlook VBO on Multiple Email Boxes

Liam_Heiniger
Level 4
I'm attempting to use the Outlook VBO with release 6.3 to pull all the sent emails from the various group emails on my Outlook but I an only get the sent emails from my default email a none of group emails. Does the out Outlook VBO allow me to pull sent emails from a group email I'm a part of, any tips, hints or suggestions about how to go about solving this issues?
1 BEST ANSWER

Best Answers

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.



------------------------------
Ami Barrett
Sr Product Consultant
Blue Prism
Plano, TX
------------------------------

View answer in original post

44 REPLIES 44

AmiBarrett
Level 12
I haven't used the 6.3 VBO, but I did wind up writing my own object to interface with Outlook via MAPI after getting fed up with the instability of MAPIex. If you're willing/able to write your own as well, there is a connection option to define use of a shared mailbox. Alternatively, you might be able to set it up as a separate Outlook profile. If the Outlook VBO in current releases is similar to the prior mail handlers, profile should be an optional field.

Liam_Heiniger
Level 4
Hi Ambarrett, The MAPIex is able to deal with multiple mailboxes with multiple profiles however, it doesn't have the ability to search by subject. Do you think it would be easy to build in subject or filter search functionality in the MAPIex object?  Thanks for getting back to me, looking forward to hearing from you. 

AmiBarrett
Level 12
As far as I know, the Outlook automation library doesn't allow for that (directly), as they're all looked up by message ID instead.   What you could do, is code it to loop through a box until it finds a specified subject. It won't mimic the search function you actually get in Outlook, but it'll get the job done. But again, this would involve a custom mail handler and not MAPIex. If you are dead-on intent to stick with MAPIex, you'll need to keep calling 'Get Next Mail' and check the subject that way. But be aware that checking this way is significantly slower than it would be in a custom code stage. (Though if you were to instead write this as an external powershell script file, it would be slower than looping through MAPIex results.)

Liam_Heiniger
Level 4
Thanks for the information. I'm actually pretty keen on using the new MS Outlook EMail VBO as I like to use the Save Email As File Action along with the Get Sent Items and Get Receive Items actions. Thanks for the help, if you do think of to have the new MS Outlook Email VBO to interact with multiple group emails please let me know. 

AmiBarrett
Level 12
I just imported it into my instance of BP5x. Looks like it should work, if you can supply the correct folder ID. It may just take some trial and error to figure out the folder's ID number.   There are ways of doing this with code,  but it may be quicker to just iterate through a list of numbers and see which one happens to be the correct one.

Anna_BlytheHewi
Level 2
Hi Liam, I am facing the same issue. Have you figured out a workaround yet?

AmiBarrett
Level 12

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

JamesSmith1
Level 2
Hi Ami, Where would you place that code stage within the ""Get Received Items (Basic)"" MS Outlook Email VBO?  I ask as I want to be able place restrictions on the emails being aggregated.

AmiBarrett
Level 12
All of the Get Items actions just call the ""Internal_Get Items"" page, which is intentionally unpublished. You'll need to modify the code stage on that page, then modify the page reference on your Get Sent Items and Get Received Items actions. You'll also need to add those two fields to the start stages on all of these pages, including ""Internal_Get Items"". Assuming you update the page reference with these new variables (defaulting to blank is fine), that should be all you need to do.