Open and save attachment

Hi,

I am looking to do the following:

  1. Open outlook email attachment
  2. Save attachment to a specified folder location

Problems

  1. Is there a function in UI Path that allows you to open an attachment? Or do you have to use something like click image?
  2. I’ve tried to use the save attachment function and I’ve specified where I want the file to go but nothing seems to get saved. I’ve attached my project so far.

Many thanks in advance for your help.

Regards,

JeffMain.xaml (26.9 KB)

Hi @JeffNZ,
I am attaching a basic workflow which gets your emails (no need to keep your Outlook open). It gets the messages, checks the subject of each of them whether it matches some certain criteria (here if it contains a string starting with “1” followed by 8 digits). If so, it will download the attachments to a designated folder.
If you want to open an attachment straight from Outlook without saving it somewhere, it may not be possible - please e.g. see the below thread:


get message.xaml (10.0 KB)
Does this solve your issue? :slight_smile:

Hello,

Thanks for that. What is a recommended solution for doing the following given that it isn’t possible to open a PDF from outlook direct?

  1. Open outlook, retrieve PDF and save to directory
  2. Open saved PDF in directory
  3. Insert Text on PDF and Save

In simple terms after I have saved a PDF from outlook I want to be able to open that saved PDF, amend it and save it again. I’ve saved my project so far. I’d like to get to the point where the process is smart enough to pick a PDF in this folder and process it, before moving to the next one.

Regards,

JeffPDF_Data_Scraping_2.xaml (20.6 KB)

1 Like

Hi @JeffNZ,
I am unsure how you want to insert text to PDF - perhaps by the method suggested in this thread:


To open the attached file you have just saved in a designated folder (like e.g. in the workflow “get message” I have previously submitted) you can use each pdf attachment name (it contains a file format extension) to combine it with the previously used address. “Invoke power shell” will open this file for you using the file path you have just created. Then, it depends how you want to fill the document out. For example, the above thread suggests to convert the pdf to a word document to be able to change it and then converting the doc to a new pdf.
get message save open the attachmnt.xaml (13.8 KB)

2 Likes

Hi,

Your solution solved my issue using the invoke method. Thanks very much!

Jeff

No problem at all, Jeff :slight_smile:

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