How to rename the attachment file after downloading from outlook.?

how to rename the attachment file as “FileName” + “_” + datetime.today(ddMMyyyyHHmmss) after downloading from outlook.??

i am saving this attachment file in my local folder and i am maintaining the path of folder at Config.xml.

Thanks,
Neha

Can someone help Neha if you have time.Thanks. @certified

1 Like

We are on a call right now lol

1 Like

You can loop through the attachments of email and then use attachment ContentStream method to save the attachment using different name. see this link https://forum.uipath.com/t/how-to-save-perticular-file-from-outlook-when-the-attachments-contains-multiple-files/921/2

We used Stream Clase XAML provided by @andrzej.kniola How to save perticular file from outlook, when the attachments contains multiple files - #3 by aksh1yadav

I was unable to find the original post… but thanks perhaps you can share the XAML @NehaGhodki

regards

1 Like

Hi,

Here is the same approach that @andrzej.kniola but extracted as a reusable component and expecting attachment object as input.

Arguments:

  • StrDestinationDirectory : The directory where the attachement will be save (ex: “C:\Temp”)

  • MailAttachment: The System.Net.Mail.Attachment that you will get from AttachmentCollection of a Mail object.

  • StrFileName(Optional) : The name (with extension) under what the attachement will be saved. If ommited, will be named after the initial attachment file name.

.Outlook_SaveAttachment.xaml (8.1 KB)

Cheers

4 Likes