Excel VBA MailEbvelope attachments

Hi

I use the following code to get the Subject of the email envelope

Application.ActiveSheet.MailEnvelope.Item.Subject

How do I loop through and get the file path of any attachment?
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
AlanConsultantCommented:
Hi,

I'm not really sure what you are asking for, but to add an attachment:

Application.ActiveSheet.MailEnvelope.Item.Attachments.Add "C:\Temp\MyFile.txt"

I am not actually in front of my computer right now, and I cannot recall if the 'item' object is required, so it might be:

Application.ActiveSheet.MailEnvelope.Attachments.Add "C:\Temp\MyFile.txt"


Hope that helps,

Alan.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
 
AlanConsultantCommented:
You're most welcome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.