Search a word in email inbox and download that email which searched contain searched word in .docx format


I am facing problem in searching a particular word in inbox. This Word is searched by the user at run time of project . The entered word should search throughout the inbox and download that email in word format.


Hi! welcome to community!

for getting a input from user just use input dialogue. and fill the required fields from the properties panel. and create a variable for value entred.

and take one type into activity indicate it to the search option inside the mail. then pass the variable which you created for input dialogue.


(post deleted by author)

@THIRU_NANI Thanks for your precious time

I am having a this problem statement

  1. Ask User to select 1 of the 3 parameters that are Email Subject, Sender Email ID & Sender Name. Base on that User can give input, and Bot should read emails.
  2. Let’s suppose User selected Subject, and then enters keywords for Subject like “Welcome to the family” then basically it should search for all the emails where the subject has all these 4 keywords present.

here I am Stuck in 2nd point


Please check this code helps you (3.8 KB)


@Boopathi.M Heartly Thankyou for help

But it is not downloading any attachment.



Please check attachments folder and also if that mail contains attachment



Regarding 4th point, you will be able to save your Email body in word document using Append text activity under Word scope.

  1. Install the package - UiPath.Word.Activities
  2. assign Email body to a string var like str_MailBody = mail.body.tostring
  3. In the append text activity - give the path of word document and this variable - it will save the email body in word document

Regarding attachments - you will be able to collect the downloaded attachments as you are already able to download the attachment and merge the excel files… also merging datatable gives expected result only if two datatables have same columns.