c# - Close inspector (compose window) inside the ItemSend() method in outlook -
i develop outlook adding using visual studio 2013 , addin express v.7.7.4087. wanting handle itemsend() , save item drafts , close inspector automatically, can apart closing inspector, because not allowed close inspector inside method of itemsend(), have use windows.forms.timer (close mailitem inside timer) ends error says “rcw content has been separated …………” error
are there alternative ways of doing this?
in redemption (for outlook), there way of doing same thing?
private void adxoutlookappevents1_itemsend(object sender, dxolitemsendeventargs e) { outlook.mailitem mailitem = null; outlook.recipients recipients = null; mailitem = e.item outlook.mailitem; try { // code goes here if (editbuttonclicked || swoffline) { e.cancel = true; if (swoffline) { mailitem.save(); timer.start(); } } } catch (exception ex) { } { } }
the timer work fine long keep in mailitem object referenced. looks mailitem variable declared on local level, garbage collected.
Comments
Post a Comment