現在、私はOutlookで作業しており、項目のリストを繰り返しています。リスト/コレクションから特定のタイプの最後のアイテムを取得するには?
問題があります: 現在のアイテムが最後のアイテムである場合は、foreach-loopで質問しますが、この種の問題は解決できません。
これは私のコードです:
lastAppointmentItem = myAppointmentItems.GetLast();
foreach (Outlook.AppointmentItem myItem in myAppointmentItems)
{
// Types
// myAppointmentItems = Outlook.Items
// myItem = Outlook.AppointmentItem
if(myItem.Equals(lastAppointmentItem)) { do_something(); }
}
私は
System.Runtime.InteropServices.COMException:
// The last element of the list cannot be called
を取得するプログラムを実行すると、どのように私は私の問題を解決することができます - あなたたちは知っていますか?
ありがとうございます!
ご挨拶。