0
我需要從Outlook外接程序中選擇一個mailitem。我正在嘗試使用在對話視圖中更改Outlook中的mailitem選項從c#outlook加載項
Outlook._Explorer explorer = OutlookApp.ActiveExplorer();
explorer.AddToSelection(item);
而且沒關係,但前提是沒有選中「Show as conversations」標誌。當它被檢查時,我收到錯誤「您調用的方法對於對話視圖無效。」當「顯示爲對話」標誌被選中時,我怎樣才能選擇一個mailitem?
不,你不能和它的文檔Explorer.IsItemSelectableInView方法http://msdn.microsoft.com/en-us/library/office/中註明ff868297(v = office.15).aspx 「如果當前視圖是對話視圖,則IsItemSelectableInView方法會引發錯誤。」 AddToSelection方法在此條件下引發相同的錯誤。 – 2014-10-09 06:42:34
你說得對 - 我應該嘗試過。 AddToSelection沒有提到它不能用在對話視圖中,但它應該。 – 2014-10-09 16:00:29