Как перебирать напоминания Outlook? - PullRequest
0 голосов
/ 05 августа 2020

Запросы на Reminder элементы в Microsoft.Office.Interop.Outlook, кажется, они все null s:

using System.Linq;
using Microsoft.Office.Interop.Outlook;

namespace OutlookDotNet
{
    class Program
    {
        static void Main(string[] args)
        {
            var outlook = new Application();
            int remindersCount = outlook.Reminders.Count; // 624 items, but Outlook shows 540
            int nullRemindersCount = outlook.Reminders.Cast<object>()
                .Count(reminder => reminder == null); // They're all null: 624 items :-(
        }
    }
}

Кроме того, мой Outlook показывает другое число - 540:

Напоминания Outlook

Я использую Microsoft Outlook 16.0 Object Library (Version 9.6, File Version 16.0.10001.10000)

Итак, как я могу перебирать напоминания Outlook?

1 Ответ

0 голосов
/ 12 августа 2020

Вы можете попробовать следующий код, чтобы перебрать напоминание Outlook.

    var outlook = new Application();
    int remindersCount = outlook.Reminders.Count;
    foreach (Reminder item in outlook.Reminders)
    {
        Console.WriteLine(item.Caption);
    }

На основе приведенного выше кода вы можете получить подпись напоминания.

...