c# - EWS - Outlook Interop Synchronize -


i'm using exchangeserver 2010 sp2 , outlook 2013

first i'm saving mail draft folder using ews

emailmessage.save() 

after i'm trying open mail via interop i'm getting comexception item doesn't exist

        outlook.application app = new outlook.application();                     outlook.namespace mapi = app.getnamespace("mapi");                     outlook.mapifolder draftfolder = mapi.getdefaultfolder(outlook.oldefaultfolders.olfolderdrafts);          //custom function entryid         string entryid = getmessageid(email,idformat.hexentryid);         string storeid = draftfolder.storeid;          mailitem item = null;          try         {             item = mapi.getitemfromid(entryid, storeid);         }         catch (comexception)         {             //item not found         } 

is there way force outlook sync draft folder exchange server?

i have used session.sendandrecieve(true)

but doesn't show effect , can't find other interop functions doing desired thing.

edit: when disabling cache-mode runs fine turn on have no clue how force message

thank much!

you can either

  1. wait until sync finishes - use namespace.syncobjects collection, retereive first syncobject object, call syncobject.start , wait syncobject.syncend event fire.

  2. on extended mapi level (c++ or delphi) or redemption (it wraps extended mapi , can used in language), open message in online mode using mapi_no_cache (0x200) flag (imsgstore::openentry in extended mapi or rdostore.getmessagefromid in redemption).


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

How to provide Authorization & Authentication using Asp.net, C#? -

How to use Authorization & Authentication in Asp.net, C#? -