如何通过右键单击c#vsto从outlook日历视图中选择会议或约会。我发现这样做的唯一方法是获取outlook文件夹并按开始和结束日期过滤它。这种方法的问题在于,如果在同一范围内找到两个约会,则无法选择要显示的约会。有什么想法吗?
private void GetAppointment()
{
Outlook.Explorer expl = Application.ActiveExplorer();
Outlook.Folder folder = expl.CurrentFolder as Outlook.Folder;
Outlook.View view = expl.CurrentView as Outlook.View;
if (view.ViewType == Outlook.OlViewType.olCalendarView)
{
Outlook.CalendarView calView = view as Outlook.CalendarView;
DateTime dateStart = calView.SelectedStartTime;
DateTime dateEnd = calView.SelectedEndTime;
// Find the appointment
}
}
答案 0 :(得分:1)
使用Application.ActiveExplorer.Selection集合。