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;
.....
}
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;
.....
}