0
我试图以编程方式更改重复项目(并使例外)。在Outlook加载项中保存例外
该项目是一个Outlook 2010 AddIn。
我试着下面的代码,但一对夫妇后,保存在calitm.Save()
命令
extracted ="somelocation"
//that's a fancy way to iterate on a list of appointment items
for (int i = 0; i < filterAppointmentsToChangeLocation.RecordCount; i++)
{
int selrow = 1
var calitm = filterAppointmentsToChangeLocation.data[selrow].GetOlAppointment();
//this returns an appointmentitem that is associated with a form
//that contains the location property
calitm.UserProperties["location"].Value = extracted;
calitm.Save();
Marshal.ReleaseComObject(calitm);
}
你有什么建议退出代码? thnx你的时间...
你什么意思保存,输出或再次引发你的异常。每种方法会做什么?我可以重试保存吗?保存应该在每个项目上执行是相当重要的 –
看看这里http://stackoverflow.com/questions/14973642/how-using-try-catch-for-exception-handling-is-best-practice看看用异常处理你可以做什么;您可以尝试重播您的保存,或通过重新抛出异常来停止for循环 – bsoulier