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