Saving attachements from outlook, with new name


#1

This one is tricky i think. I have got a lot of emails in outlook, each one with one attachement. I want to download all the attachements, and in the process rename the attachements with the subject line from the e-mail.

e.g. one e-mail has an attachement with the name “w512JA00038_201706201204333-001.pdf”. The e-mails subject line reads “030476-2357”. I want the attachement renamed “030476-2357” when downloaded.

I have already figured out how to download the attachement, but i dont know how to do the renaming of the files?

Can anybody help?

Best regards,
Sofus


How to save email attachment while renaming it
#2

Get the name of the attachment

save the attachment, and the rename it.

this should work if you only have one attachment per email like you say.


#3

Thanks for the answer, but i don’t see how that will work? As far as i can figure out, If i move the files to the same folder, i have to specify the new name for the file in the proces. I want this part to be automated.

I have the attachments (PDF files) in a folder, and i have a variable where the subject lines are stored. Each mail in the attachement folder have to be renamed with the corresponding subject line from the mail from which the attachment was downloaded from.

I need a renaming option where i can insert output from the variable in which i store the subject lines. Is this possible?


#4

not sure if you got this sorted.

You could use "invoke method"
target type: System.IO.File
object: null
MethodName: Move

and set you parameters as old name and new name e.g
"C:\test\test.csv" and “C:\test” + Variable + “.csv”