Microsoft Interop OutLook C#- Cannot save attachments of type OLE -


i have c# program saving attachments unread emails outlook mail box folder , below line of code breaks(first line) attachment types of ole type error "outlook cannot perform action on type of attachment"(where 'it' of type mailitem).

string attachedfilename = it.attachments[i].filename; it.attachments[i].saveasfile("c:\\temp\\"+attachedfilename); 

i have read articles on using http://www.dimastr.com/redemption/rdomail.htm (library) overcome problem ole type attachments, apart option can make use of other .net library overcome problem?
if yes, kindly share code snippet in c#.

you need call iattach::openproperty(pr_attach_data_obj, iid_istorage, ...) open particular stream istorage contains data after. note stream , format specific application created ole attachment. redemption supports word pad, paint brush, excel, power point, word, open office, acrobat, bitmap, metafile, etc. formats.

iattach::openproperty available in extended mapi (c++ or delphi), cannot in c#.

to see data stored in outlook, take @ attachment outlookspy: select message, click imessage button, go getattachmenttable tab, double click on attachment, right click on pr_attach_data_obj property, select imapiprop::openproperty, select istorage interface.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -