How to open Calendar C#

S

Steve

Now that I found the Outlook public folder containing an
existing calendar, how do I open the calendar?

And , what if the XP network user has Outlook closed or
minimized in the
background
How should I address Logon() or do I need to address it?

************************
openOutlookCalendar()
{

Application olApp = new ApplicationClass();
NameSpace olNS = olApp.GetNamespace("MAPI");

MAPIFolder objFolder
= olNS.GetDefaultFolder
(.OlDefaultFolders.olPublicFoldersAllPublicFolders);

//nested foreach & if at third folder level
foreach (objfolder3 in objfolder2.Folders)
{
//I found folder below containing the
//existing "confRoomCalendar"
if (objfolder3.Name == publicFolderLevel3)
{
//How do I open the calendar?
}}}
 
D

Dmitry Streblechenko

1. You already have it open - doesn't objfolder3 point to thee folder you
need?
2. Yes, do call olNS.Logon - if Outlook is already running, the call won't
do anything.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
S

Stephen Bianco

yes it does, but how do I physically open the calendar so it pops up
(opens) on the screen. objfolder3 contains 3 different calendars. I
want to say something like:

if (objfolder3.Name == publicFolderLevel3)
{
olNS.Logon(...);
objfolder3.conferenceRoomCalendar.Open();
}

Steve
 
D

Dmitry Streblechenko

Use either MAPIFolder.Display() (if you want to open the folder in a
separate explorer) or Application.ActiveExplorer.CurrentFolder = YourFolder
to reuse the current explorer.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top