How to merge all attachment from email outlook and save in computer

Hi All,
I want to download all attachments(all pdf) from outlook email and merge it into one pdf file.
Anyone know how to do that by using UIPATH?
Many thanksssss

Hi @tra_my_Tran

You can use save attachment activity to save your pdf files and to merge you can use merge pdf files activity.

Thanks,
Shenki

@ShenkiSinghai, how can I get the attachments names so that I can merge it later?

You can have Directory.GetFiles(Path) which returns all the files in specified folder. From this u can loop and merge

Please refer attached example workflow, you just need to integrate it with mail automation and save the attachments.

In the given attachment, you have to do:

  1. Read all the mails and place your all attachments (pdf, docs, xaml, xlsx) in folder Files, using save attachment activity

Workflow will copy all the pdf files and place it in different folder named CopiedPDFs, then it will merge all PDFs in this folder and place it in Result folder.

PDF.zip (48.2 KB)

Thanks,
Shenki

Hi @ManojBevara, I am still new with UIPATH, can you eleborate more on how to create the loop to merge each folder?

Create a string array variable PdfFiles

           Assign Activity : PdfFiles = Directory.GetFiles("C:\Users\Manoj\Documents\InputFolder","*.pdf")
           Join PDF Files Activity : FileList = PdfFiles 
                                                  OutputFileName = "C:\Users\Manoj\Documents\OutputFolder\OutFile.pdf"

Thats it

1 Like

Hi @ManojBevara, it works, thank you so mucchhhhh :slight_smile:

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