Create Mail Folder in Outlook

outlook

#1

Hi, Currently the move outlook mail activity will fail if the mail folder is not exist. If there any activity to create mail folder if not exist? Thanks.


#2

Try Path Exists it return a Boolean value True or False.
Hope that will be helpful


#3

hope Path exists can be applicable for paths not for outlook folders. if you have sample can you please share how can we check folder exists in outlook

BR,
Pathrudu


#4

Yes Pathrudu,
i think we have to use element exists property and add selector for respective folder to handle this.
How ever, it is one time setup to create a folder in outlook. So no need to verify every time.
Hope my inputs are useful.


#5

@rkelchuri he wants to check and create folder which means we need to check every time before moving mail. It won’t be one time activity.


#6

here is the solution.
image
use above selector in get text activity
iterate based on highlighted idx value and you can get folder name in a string.
you can exit loop if string value is empty.
Once you get folder name then you know how to play with conditions…


#7

Do I need to open outlook every time when I use Get outlook messages activity?


#8

It will work when outlook is in minimized condition also but out look should available.


#9

Thanks for your information let me try


#10

Check this, pretty simple solution. If you have to use this in your project, please add the below Assembly to your Xaml.

image

outlookFolders.xaml (11.9 KB)


Get outlook mail messages : The specified folder does not exist
#11

Thanks all for the suggestions.


#12

how to create a subfolder in outlook? If you know that, please tell me,many thanks!


#13

Hi Christine,

you got any solution to create sub folders ???


#14

Similar to the solution @vvaidya have already provided.

Every folder in Outlook have Folders collections.

We can modify his example to create folder inside Inbox.
“Assign activity” NewFolder = oFolders(“Inbox”).Folders.Add(“test”,Type.Missing)
Or we can create two of them for 2 level hierarchy
NewFolder = oFolders(“Inbox”).Folders.Add(“test1”,Type.Missing).Folders.Add(“test2”,Type.Missing)