cancel
Showing results for 
Search instead for 
Did you mean: 

Flag Email Outlook

SebT
Level 4
Hi all

I am looking to create a code stage that given Mail ID, Outlook Profile and Subfolder as inputs will mark the particular email with a flag and/or mark it with a color.

I have looked into the FlagStatus property but haven't been able to get it to work.

Has anybody had any luck achieving this?

Thanks

------------------------------
Seb T
------------------------------
1 BEST ANSWER

Best Answers

AmiBarrett
Level 12

Hopefully this helps!

Inputs:
Profile - Text
Subfolder - Text
ID - Text
markAs - Text (Expects "flag" or "done")

Outputs:
N/A

Dim Outlook as object
Outlook = CreateObject("Outlook.Application")

Dim ns as object
ns = Outlook.GetNameSpace("MAPI")

if Profile <> "" then
    ns.Logon(Profile, , True, True)
end if
Dim item = ns.GetItemFromID(ID)


if markAs = "flag" then
	item.FlagIcon = 6
	item.FlagStatus = 2
	item.FlagRequest = "Follow up"
	item.ReminderSet = False
else if markAs = "done" then
	item.FlagIcon = 0
	item.FlagStatus = 1
	item.FlagRequest = "Completed"
	item.ReminderSet = False
else
	item.FlagIcon = 0
	item.FlagStatus = 0
	item.FlagRequest = ""
	item.ReminderSet = False
end if


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

View answer in original post

3 REPLIES 3

AmiBarrett
Level 12

Hopefully this helps!

Inputs:
Profile - Text
Subfolder - Text
ID - Text
markAs - Text (Expects "flag" or "done")

Outputs:
N/A

Dim Outlook as object
Outlook = CreateObject("Outlook.Application")

Dim ns as object
ns = Outlook.GetNameSpace("MAPI")

if Profile <> "" then
    ns.Logon(Profile, , True, True)
end if
Dim item = ns.GetItemFromID(ID)


if markAs = "flag" then
	item.FlagIcon = 6
	item.FlagStatus = 2
	item.FlagRequest = "Follow up"
	item.ReminderSet = False
else if markAs = "done" then
	item.FlagIcon = 0
	item.FlagStatus = 1
	item.FlagRequest = "Completed"
	item.ReminderSet = False
else
	item.FlagIcon = 0
	item.FlagStatus = 0
	item.FlagRequest = ""
	item.ReminderSet = False
end if


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

Awesome, will try it out! Thanks!

------------------------------
Seb T
------------------------------

expertcr
Staff
Staff
Good morning

Just FYI our most recent version of MS Outlook VBO support flag email, this VBO is included in Blue Prism 6.8 and is work in the previous versiosn of BP.
29955.png

Have a good day.

------------------------------
Luis Lopez
Customer Support Engineer English and Spanish
Blue Prism Ltd
------------------------------