c# - Save an exception on an Outlook add-in -


i trying programmatically change items of recurrence (and make exceptions).

the project outlook 2010 addin.

i tried following code after couple of saves code exited @ calitm.save() command

extracted ="somelocation"    //that's fancy way iterate on list of appointment items (int = 0; < filterappointmentstochangelocation.recordcount; i++) {     int selrow = 1     var calitm = filterappointmentstochangelocation.data[selrow].getolappointment();     //this returns appointmentitem associated form      //that contains location property      calitm.userproperties["location"].value = extracted;     calitm.save();      marshal.releasecomobject(calitm); } 

do have suggestions? thnx time...

if code exists means crashing during call save method.

you need try/catch faulting code can save/rethrow exception

for (int = 0; < filterappointmentstochangelocation.recordcount; i++) {     int selrow = 1     var calitm = filterappointmentstochangelocation.data[selrow].getolappointment();      try     {         calitm.userproperties["location"].value = extracted;         calitm.save();     }     catch (exception e)     {         // save, output or retrhow exception.         system.io.file.writealltext (@"c:\somepath\error.txt", e.message);     }     marshal.releasecomobject(calitm); } 

Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -