Create Mail Folder in Outlook

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.

1 Like

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

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

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.

@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.

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…

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

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

Thanks for your information let me try

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)

11 Likes

Thanks all for the suggestions.

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

Hi Christine,

you got any solution to create sub folders ???

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)

3 Likes