Save Outlook Email - Character Error saving .msg?

Hi everyone,

I’m doing a very simple project but i cant save the emails where i want…

Create a Folder named with the Subject, save inside The Email and The Attachments, but i have an error just when i want so save se .msg in the same folder.

But In this case i have an error:
Activity Save Outlook Email ( Save Mail X ) failed:
Error en la operación.

i check many times and i guess the problem is the “-” character in Subject, Is there any options to avoid this error?

Thats my proyect:

Thanks for your patient

Did you try the following:

Hello,
it doesnt work for me, i’m using StudioX, the links you provid me talk about Studio, in this case it use get mail before the FOR expression, i cant use it on StudioX.

Check that when i use Subjects with normal characters it works (“Prueba 3”), but when i use Subjects with other chars thats the output:

System.NotSupportedException: The given path’s format is not supported.
at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at System.IO.Directory.CreateDirectory(String path)
at UiPath.Mail.Activities.Business.SaveMailX.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

I made this change but still failing:
image

thanks

hello, can you give me the exact subject or the charaters you say it throws the error? I tried using “-” in the subject and used the subject for creting the path and i got the same error and that’s a bug since the OS supports that. let me know if that is the case for you also, the “-” i mean. thank you.

1 Like

“The given path’s format is not supported.” can you show which path you entered?

so, i played a little further with it.
that might be a bug that you get any thing on the sub menu or that the folders are created inside the project folder but it can’t save to them. we will investigate

furthermore, as a workaround for you scenario, save all email with filename [subject] in a common folder, then using IF-condition builder move each file in it’s appropiate folder. You have Create Folder and Move File for that.

Ofc,

C:\MEJORAS\Auditoria<[CurrentMail.Subject]>

Subjects Like, “AUDITORÍAS SOC - SUPERVISORES 15_04_2020 TT” doesn’t work

When i jtry to save atachment in C:\MEJORAS\Auditoria<[CurrentMail.Subject]>, i get an error saving, also it made 3 Folders with current subject like this:
image

Hi,

i can’s use Create folder, when i try it i have the same problem.
image

I can save the Outlook email but cant create folder, so, it’s not a .msg problem, it’s a Create Folder problem

In the original subject in outlook client you have \ or / instead of _
AUDITORÍAS SOC - SUPERVISORES 15_04_2020 TT
the mail are automatically saved with _ instead of \ or / but when creting folder it will take into account the / that’s why you get the path splited. that’s a OS limitation.

then you can use a for each file in folder → create folder-> current file->name and will create the folder for each saved emails but with _ instead of \ or / and then move each of them to it’s appropiate folder.

happy automation!

Make sure that the path to the file contains fewer than 219 characters. To do this, use one of the following methods:

Rename the file so that it has a shorter name.

Rename one or more folders that contain the file so that they have shorter names.

Move the file to a folder with a shorter path name.

Regards,
Rachel Gomez