Search code examples
c#outlookvstoadd-in

VSTO: Open the calendar explorer in a new window


i found this question: Switch To Outlook Calendar using VSTO.

This works quite fine, but I want to open the Calendar in a new window to not change the users current window.

I could not find any information on how to do this, or if it is even possible. Thanks for any help!


Solution

  • Ok, I think I found it:

     Explorer explorer = Globals.ThisAddIn.Application.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderCalendar).GetExplorer();
    
     CalendarView calView = explorer.CurrentView;
     calView.CalendarViewMode = OlCalendarViewMode.olCalendarViewWeek;
     calView.GoToDate(date);
     calView.Apply();
    
     explorer.Activate();