We do not have option to save attachment without lookif you want to save from multiple emails…but we can avoid the if condition by adding filters in outlook get mail messages activity.This will get only the emails with required subject
Yes, it is possible to download an attachment from the Get Outlook Mail Messages activity and save it to a local folder in UiPath. To do this, you can use the following steps:
Use the Get Outlook Mail Messages activity to retrieve the email message containing the attachment you want to download.
Iterate through the retrieved email messages using a For Each loop.
For each email message, use the Get Attachments activity to retrieve the attachments.
Iterate through the attachments using another For Each loop.
For each attachment, use the Save Attachment activity to save the attachment to a local folder.
Here is an example of how this could be implemented in UiPath:
Copy code
// Set the email account, folder, and local folder where the attachment will be saved.
string emailAccount = "user@example.com";
string folder = "Inbox";
string localFolder = "C:\\Attachments";
// Use the Get Outlook Mail Messages activity to retrieve the email messages.
IEnumerable<MailMessage> messages = GetOutlookMailMessages.GetMessages(emailAccount, folder);
// Iterate through the email messages.
foreach (MailMessage message in messages)
{
// Get the attachments for the current email message.
IEnumerable<Attachment> attachments = GetAttachments.Get(message);
// Iterate through the attachments.
foreach (Attachment attachment in attachments)
{
// Save the attachment to the local folder.
SaveAttachment.Save(attachment, localFolder, attachment.Name);