cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Outlook Profiles using Outlook VBO

Venkata_Pranav_
Level 6
Will there be any support on reading emails from multiple Outlook profiles using the latest Outlook VBO. As of now, Outlook VBO could only read the default Outlook profile. 
Pranav
1 BEST ANSWER

Best Answers

You'll need to modify the code stage, as well as the inputs on "Internal_Get Items" and "Get Received Items (Basic)" for this to work. (Alternatively, grab the version I've uploaded and rename the extension to .bprelease, located here: https://community.blueprism.com/viewdocument/re-outlook-email-vbo?CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&tab=librarydocuments ) 

I'm going to list the modifications to the code stage. You should be able to figure out the rest from there. sharedEmail allows for shared inboxes on the same Outlook profile.

Additional inputs:
Profile - Text
sharedEmail - Text

The top of the code stage should look like this:
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder = _nameSpace.GetDefaultFolder(Outlook_Folder_ID)
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​


------------------------------
Ami Barrett
Lead RPA Software Developer
Solai & Cameron
America/Chicago
------------------------------

View answer in original post

52 REPLIES 52

Dan.Lister
Level 4
It is possible to use other profiles. You need to select ""Prompt for profile to be used"" within Control Panel > Mail. You can then create an object to select which profile you wish to use from the Choose Profile window upon launching Outlook.    

AmiBarrett
Level 12
I think he means programatically switching between profiles, like you could in MAPIEx. The process to modify the VBO to handle this has been covered here: https://portal.blueprism.com/forums/technical-queries/general/outlook-v…

Hi Team,

I am using outlook Email VBO ,which works fine but i have few queries in that VBO

1) when i use the action: Get Received Items(Basic)--it works perfect if i pass the "Sub Folder" and "Sender Name" as inputs but when i pass Mail id it does not give me any output even though the mail id is proper and Valid
2) With one profile in my outlook it works properly but then i have 4 profiles in my same outlook so how do i point to the right profile by using this Outlook Email VBO

Regards,
Manoj

You'll need to modify the code stage, as well as the inputs on "Internal_Get Items" and "Get Received Items (Basic)" for this to work. (Alternatively, grab the version I've uploaded and rename the extension to .bprelease, located here: https://community.blueprism.com/viewdocument/re-outlook-email-vbo?CommunityKey=3743dbaa-6766-4a4d-b7ed-9a98b6b1dd01&tab=librarydocuments ) 

I'm going to list the modifications to the code stage. You should be able to figure out the rest from there. sharedEmail allows for shared inboxes on the same Outlook profile.

Additional inputs:
Profile - Text
sharedEmail - Text

The top of the code stage should look like this:
Dim app = CreateObject("Outlook.Application")
Dim _nameSpace = app.GetNameSpace("MAPI")
Dim folder = _nameSpace.GetDefaultFolder(Outlook_Folder_ID)
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​


------------------------------
Ami Barrett
Lead RPA Software Developer
Solai & Cameron
America/Chicago
------------------------------

Hi Ami,
​I downloaded your release and tried running it.  It runs through but doesn't pull anything. 

For input paramenters on the action...........I've tried it with nothing in the Shared Email and I've tried it with the full email in shared folder and I've tried it with how the shared box shows up in my email.  None of them seem to be pulling anything but don't error out.  If I try to add my subfolder of "Test" it then says object can't be found.  So that makes it seem like it is being read.  Any ideas on how to get it going?

Thanks,
Jon

6530.png


------------------------------
Jonathan Holstine
Systems Accountant
Interior Business Center
America/Denver
------------------------------

Just tested locally. Try adding values for "Include Read" and "Include Unread".

Previously when I had written this, these were not required. I'm starting to wonder if there's something to do with the version of Outlook.

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

​Hi Ami,
I'm sorry I'm new to outlook and this language.  Can you send the exact code syntax I would need to add.  Would I just put this below the Sub_Folder and before the End If?

6543.png


------------------------------
Jonathan Holstine
Systems Accountant
Interior Business Center
America/Denver
------------------------------

If you downloaded the VBO I provided, you don't need to add anything. If you're using the stock VBO, it's provided in the same post with the link.

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

Anonymous
Not applicable
Hi Ami, 
I tried the VBO you provided and it is working and extracting mails from my account. But if I change "Profile" to another account, it is still extracting mails from my account. The only fields set are Profile and Include Read and Include Unread, bot True.

Outlook version is 2013/32bit.

Reiner

------------------------------
Reiner Volbers
------------------------------