outlook vba - Saving "Device Independent Bitmap" attachment -
how save kind of attachment (from signed message)? saved .saveasfile method, without extension , no application can open it.
set outitem = application.activeexplorer.selection.item(1) each att in outitem.attachments att.saveasfile "c:\temp\" & att.displayname next
for olole attachments, need open attachment istorage com object , extract data (which can mangled) 1 of streams inside storage - can see data in outlookspy: select message, click imessage button on outlookspy ribbon, go getattachmenttable tab, double click on 1 of attachments. select pr)_attach_data_obj property, right click, imapiprop::openproperty, select iid_istorage. data cannot accessed in vba using outlook object model
if using redemption option, rdoattachment.saveasfile method smart enough extract bmp, emf, pdf, excel, etc. file data storage. following (off top of head) should job:
set session = createobject("redemption.rdosession") session.mapiobject = application.session.mapiobject set rmsg = session.getrdoobjectfromoutlookobject(application.activeexplorer.selection.item(1)) each att in rmsg.attachments att.saveasfile "c:\temp\" & att.filename next
Comments
Post a Comment