Click to See Complete Forum and Search --> : Accessing outlook appointments


john_avi
January 21st, 2010, 07:02 AM
Hi All,
I have developed a small application in MFC which accesses a C# dll. This C# dll reads outlook calendar appointments using Outlook object model. The following code works fine except that it prompts a security warnning "A program is trying to access email address information stored in outlook......" Allow/Deny. I wanted to avoid this security prompt. I googled a lot. I read that if I use Extended MAPI/CDO I won't get this warning but could not get some proper code guidence. So if somebody can tell me how can I restructure my code to use Extended MAPI. I have also read that this warning does not com for trusted COM-addins but I don't want my application to be an Outlook Addin. So please help me

Microsoft.Office.Interop.Outlook.Application outLookApp = new Microsoft.Office.Interop.Outlook.Application();
NameSpace nms = outLookApp.GetNamespace("MAPI");
MAPIFolder mpiFolder = nms.GetDefaultFolder(OlDefaultFolders.olFolderCalendar);

foreach (AppointmentItem task in mpiFolder.Items)
{
//creating the appointment data string.
String subject = task.Subject;
String location = task.Location;
String body = task.Body;
.....
}

HanneSThEGreaT
January 21st, 2010, 07:28 AM
I think that response is built in to Outlook. I myself have had lots of issues with this message, so, I'm also open to suggestions. But in my honest opinion, I don't think there is hope for you. :)

john_avi
January 21st, 2010, 07:54 AM
But i have read that if we obtain application object through some session object then this message does not appear. While looking for application object it loads some default security profile.So it should be possible to do it without that warning. Some other application also do it(for ex- Google calendar sync).