C#: Save embedded Image from Outlook MailItem -
i'm trying save embedded image outlook mailitem (html-body), don't find in property embedded image stored , how can save it.
i have tried image property .attachments (i have tried index 0) exception thrown array-index out of range. means, there no attachment in e-mail.
but if image not stored in "attachments" image stored , how can save filesystem?
thank in advance answers!
best regards matthias
i have found solution myself.
the problem was, accessing mailitem other thread. don't know why thread can't see attachments. after putting mail-reading-part inside
this.dispatcher.invoke(new action(() => { ... }));
it works fine. can access inline image code...
if (mail.attachments.count > 0) { (int = 1; <= mail.attachments.count; i++) { mail.attachments[i].saveasfile(@"c:\test\" + mail.attachments[i].filename); } }
Comments
Post a Comment