c# - Don't save embed image that contain into attachements (like signature image) -
i work on vsto in c#. when click on button save attachment in folder. problem : when have rich email image in signature, have element in attachment. don't want save image. outlook (application) hide attachment in area attachment ! why not me :-(
my code :
mailitem mailitemselected = this.outlookitem; foreach (attachment in mailitemselected.attachments) { a.saveasfile(path + a.filename); }
but don't find test don't save image of signature.
we had need show "mail attachments" (not embedded ones used rendering) in outlook add - in, , works.
if (mailitem.attachments.count > 0) { // attachments foreach (attachment attachment in mailitem.attachments) { var flags = attachment.propertyaccessor.getproperty("http://schemas.microsoft.com/mapi/proptag/0x37140003"); //to ignore embedded attachments - if (flags != 4) { // per present understanding - if rtf mail attachment comes here - , embeded image treated attachment type value 6 , ignore if ((int)attachment.type != 6) { mailattachment mailattachment = new mailattachment { name = attachment.filename }; mail.attachments.add(mailattachment); } } } }
Comments
Post a Comment