0
votes

I already have outlook addin which check some attachments before sending an email. But I found that I can add in email one file several times or two or more different files with the same name.
I need to save some of the attachments (depends on extension), then do some work with them. After that, I replace those files which were processed without mistakes and show a message to the user if I had some problems.
All works fine if files have different names. But I don't know how to separate three excel files (as an example) with different tables inside, but the same name. Is there some property for creation date of file? Or some outlook Id? I don't think that file size will be enough.

1

1 Answers

0
votes

If files are attached to the same email the easiest way is to use the Attachment.Index property which returns an integer indicating the position of the object within the collection. The Index property is only valid during the current session and can change as objects are added to and deleted from the collection. The first object in the collection has an Index value of 1.

Also, you can merge filename with a current date/time string. See Save specific file type as an attachment with received date time for more information.