Get filename from Outlook attachment

Hi everyone!

I want to automate a process where I download an attachment from an Outlook message (see screenshot).
I want to save the attachment/file in a folder and move it afterwards to another folder so it can be dynamic. The problem of the move file activity is that it needs the name of the file but it doesn’t know the name because I have to receive the mail first which is logical.
I thought that “listMail” in the move file activity can work but it doesn’t unfortunately :sweat_smile:
Can someone help me?

Best regards and stay healthy!


First download the file in some location using Save Attachment activity

Once you download use Directory.GetFiles(“FolderPath”)

Use as below to get the path of the file which you can use for move Activity

Hope this helps you


And which value is in the variable files?

It still says “Could not find file (and then the path which is stored in files)”.

Ok I was able to do it now! I had to create a new for each loop with the variable item in files and in the move file activity I had to write “item.ToString” and it worked out. Thank you everyone!



Mark as solution if this helps you


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.