Save attachment of outlook item

Hi Team,

I need to save pdf attachment which is there in outlook item as message…
Its like attachment in attachment.

Using save attachments , its saving only direct attachment, but not attachment in attachments

Regards
Anusha

@anusha2

Can you please show or tell what do you mean attachment in attachment

Cheers

Hi @anusha2 ,

Here are the steps you can follow:

  1. Use the “Get Outlook Mail Messages” activity to retrieve the message that contains the embedded PDF attachment.
  2. Use the “Save Attachments” activity to save the attachment to a local folder. However, since the attachment is embedded within another attachment, you need to use the IsEmbedded property to specify that you want to save the embedded attachment. Here’s an example of how you can use this activity:

mathematicaCopy code

For Each mail In mailList
    For Each attachment In mail.Attachments
        If attachment.IsEmbedded AndAlso attachment.FileName.EndsWith(".pdf") Then
            attachment.Save("C:\Users\Username\Documents\" + attachment.FileName)
        End If
    Next
Next

In this example, we loop through each attachment in the email message and check if it is an embedded attachment and if the file extension is .pdf. If it is, then we use the Save method to save the attachment to a local folder.
3. Once the attachment is saved, you can use other activities to manipulate or process the PDF file as needed.

Thanks

Hi Anil,

Thanks for your reply,

image

PDF is there in this attachment

@anusha2

Please check this…so what you need to do is after save attachments once the mail is saved…use the below code on that saved mail to extract the attachment

Hope this helps

Cheers

I think this is is helpful

I will try and let you know.

Thankyou so much

Thanks Anil,

Will try and let you know .

Regards
Anusha

1 Like

Hi,

I need to put the code in Invoke code right

Hi,

Could you please share the XAML file