Digital Exchange

last person joined: 20 hours ago 

This community is a place to discuss the Blue Prism DX and all of the assets hosted there.
Expand all | Collapse all

Multiple Outlook Profiles using Outlook VBO

Jump to Best Answer
  • 1.  Multiple Outlook Profiles using Outlook VBO

    Posted 01-02-2019 21:54
    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. 


  • 2.  It is possible to use other…

    Posted 01-08-2019 16:44
    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.    


  • 3.  I think he means…

    Posted 01-08-2019 16:46
    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…


  • 4.  RE: I think he means…

    Posted 06-05-2019 10:11
    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


  • 5.  RE: I think he means…
    Best Answer

    Posted 06-05-2019 10:52
    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
    ------------------------------



  • 6.  RE: I think he means…

    Posted 01-16-2020 17:10

    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



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



  • 7.  RE: I think he means…

    Posted 01-16-2020 17:25
    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
    ------------------------------



  • 8.  RE: I think he means…

    Posted 01-16-2020 17:47
    ​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?



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



  • 9.  RE: I think he means…

    Posted 01-16-2020 17:51
    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
    ------------------------------



  • 10.  RE: I think he means…

    Posted 01-20-2020 04:34
    Edited by Reiner Volbers 01-20-2020 04:38
    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
    ------------------------------



  • 11.  RE: I think he means…

    Posted 01-21-2020 09:21
    Just to be sure, the profile field is either blank or matching the name of a mail profile, correct? You can verify this by going to Control Panel -> Mail -> Show Profiles.

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



  • 12.  RE: I think he means…

    Posted 01-21-2020 09:37
    Hi Ami,
    whether I leave it blank, put in the name of my profile or another profile name: I only get mails from my profile. 

    Maybe I misunderstood something and/or my Outlook is not configured correctly. In the Control Panel only one profile is shown (mine). I want to send/read e-mails from another account and the owner granted me access to those folders. Therefore I put in the other accounts profile name and subfolder of that account. Then I get an error message because the folder does not exist. Obviously the VBO is checking against folder in my profile and ignoring the profile defined in the stage.

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



  • 13.  RE: I think he means…

    Posted 01-21-2020 10:25
    Edited by Ami Barrett 01-21-2020 12:50

    Sounds like you're trying to access a shared inbox. That's where the "Shared E-Mail" feild comes into play.

    Suppose under your default profile (typically either named Default or Outlook), your list of folders looks something like this:

    My.Email@mydomain.com
    >Inbox
    >>Subfolder 1
    >Drafts
    >Sent Items
    >etc etc
    
    Shared.Email@mydomain.com
    >Inbox
    >>Subfolder 1
    >Drafts
    >Sent Items
    >etc etc


    Since you have two inboxes attached to the profile, you will need to specify the e-mail address of the target inbox in the "Shared E-Mail" field. In the case of the above example, it should be set to "Shared.Email@mydomain.com" . 



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



  • 14.  RE: I think he means…

    Posted 01-22-2020 09:24
    Edited by Reiner Volbers 01-22-2020 09:25
    Hi Ami,
    thanks for your direction. I got access to the Subfolder1 (your example), but both Inbox and Shared.Email@mydomain.com did not have the "visible" flag set in the Outlook folder access settings. This is done now and with "Profile" left blank and "Subfolder"/"Shared Email" set it's working.

    Thanks again, please add this to the official Outlook VBO.

    Reiner

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



  • 15.  RE: I think he means…

    Posted 01-22-2020 09:39
    Interesting! Can't say I've run across that before. Thanks for sharing!

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



  • 16.  RE: I think he means…

    Posted 03-10-2020 14:10

    Hello!

    In my outlook i have 4 Shared Emails, and i need that BP get all unread emails from all shared email accounts, how can i do that?

    do you can give me a PrintScreen with exemple?

    Thanks!



    ------------------------------
    Cleidson Cordeiro
    ------------------------------



  • 17.  RE: I think he means…

    Posted 03-10-2020 14:14
    If you need to pull from all shared boxes at once, leave "sharedEmail" blank.

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



  • 18.  RE: I think he means…

    Posted 03-10-2020 14:58

    Thanks, i dont know why but its not working, see what i got on a exemple email:

    So i have 2 Unread Emails, one from the first inbox and another from second, but when i start the Internal MAP v2/get Mail my Items Data item only get only 1 Row.
    any idea?


    ------------------------------
    Cleidson Cordeiro
    ------------------------------



  • 19.  RE: I think he means…

    Posted 03-10-2020 15:02
    If you go into the folder properties, are they set to be visible?

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



  • 20.  RE: I think he means…

    Posted 03-10-2020 15:16

    yes, on both:



    ------------------------------
    Cleidson Cordeiro
    ------------------------------



  • 21.  RE: I think he means…

    Posted 04-20-2020 11:18
    Hi Ami,

    My requirement is the I need to send emails from Shared Mailbox and not from the BOT's profile. I cannot make shared mailbox as default profile as BOT is a shared one. Could you please provide me the code which can take the Profile name just like MAPIEX?

    ------------------------------
    Manohara M
    Senior Project Engineer
    Wipro Technologies
    Asia/Kolkata
    ------------------------------



  • 22.  RE: I think he means…

    Posted 04-20-2020 12:29
    Edited by Ami Barrett 04-20-2020 12:30
    Check the post I made at 06-05-2019 15:52 (at least on my timezone). It contains a code excerpt, as well as a fully-built VBO to handle this.

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



  • 23.  RE: I think he means…

    Posted 07-31-2020 16:13
    HI Ami, 

    I have not asked you a question personally but you my friend have been so helpful. I wanted to express my gratitude for all the help you have rendered. 

    I'm extremely interested in learning how to create/modify VBOs the way you do. If you can share a good place to start learning it will be greatly appreciated. 

    Thanks

    ------------------------------
    Heber Pereira
    ------------------------------



  • 24.  RE: I think he means…

    Posted 07-31-2020 16:35

    Honestly? Google and Stack Overflow are two of my best friends. Though when it comes to modifying an office application specifically, I'll also refer to their VBA guide. The Excel and Word VBOs are atypical compared to how you would extend the other VBOs, so I've also in the past just copied and modified an existing code stage that seemed somewhat similar.

    The short of it is: "How do I do [x] in [y] language?" So if that comes to "How do I modify a column of a collection in C#", I'll search "C# datatable modify column" and see what I can find. If it's something like shared inboxes in outlook, I'll literally just search "outlook vba shared mailbox" and go from there.

    Best practice if you're modifying an out of the box VBO, is to create a separate one and label it "Extended", so you can import new releases of the originals later on without losing any data.

    Personally, I prefer to develop anything new in C# because that's where my coding background prior to Blue Prism mostly is. The only major downside is that it makes it more difficult when trying to share actions to people who are trying to combine them with the base VBOs, because those are in VB. But really, it's all personal preference.



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



  • 25.  RE: I think he means…

    Posted 07-31-2020 17:28
      |   view attached

    I appreciate your response. 

    Question: I tried doing the above to be able to read emails from shared mailbox subfolder but I cannot get it to work. I'm able to read from the shared mailbox inbox but that's about it. 

    Do you know what could be preventing me from getting access to the shared mailbox subfolders. I made sure all the folders in the shared mailbox were visible with owner rights to my main inbox. 

    How can I get the outlook folder ID maybe if I pass the folder ID it will work. 



    ------------------------------
    Heber Pereira
    ------------------------------



  • 26.  RE: I think he means…

    Posted 07-31-2020 18:28

    The "Shared E-Mail" field needs to be the e-mail address of the shared inbox, not the label.

    If you want the folder IDs, you'd have to loop through each folder and write out the name and number someplace. Inbox always has the same folder number, so the sub-folder field would theoretically always match to that.

    Otherwise, I found that in some instances of O365, there was a security patch pushed within the last year or so that prevents this from working. If the above doesn't work, give the new version of the official VBO a try, or have your process automate Outlook to click the mailbox you're trying to read and then modify the code stage to read the currently selected folder.



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



  • 27.  RE: I think he means…

    Posted 07-31-2020 18:33

    Thank you for the answer. 

    One more thing. Where can I go to grab the latest version of the outlook VBO? 



    ------------------------------
    Heber Pereira
    ------------------------------



  • 28.  RE: I think he means…

    Posted 07-31-2020 18:38
    Edited by Ami Barrett 08-04-2020 10:31
    Either contact our support and they'll supply one, or grab the latest version and pull a copy of the VBO out of the /VBOs directory within.

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