Help!

Outlook security warning - A program is trying to access o..


Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Interoperability RSS
Next:  Exception when add attachment programmatically in..  
Author Message
Dilum
External


Since: Aug 09, 2007
Posts: 3



PostPosted: Thu Aug 09, 2007 9:06 pm    Post subject: Outlook security warning - A program is trying to access outlook
Archived from groups: microsoft>public>outlook>interop (more info?)

Our application converts various text document formats to text files. Users
can use the application to select a supported file (doc, pdf, msg etc.) to
generate a text file (.txt) .

But there is an issue with converting Outlook message files (.msg) to text
files. When trying to read the msg file with an Outlook object, a pop-up
window comes from Outlook saying that a program is trying to access Outlook.
So the users always have to grant access to the application whenever they try
to generate a text file from msg files.

The code block is shown below.
The variable “path” contains the file path to the message file.

// Create Outlook Application Object
Microsoft.Office.Interop.Outlook.ApplicationClass objOutlook =
newMicrosoft.Office.Interop.Outlook.ApplicationClass();

//Create Null Ref Object
object nullobj = System.Reflection.Missing.Value;

// Outlook Mail Object
Microsoft.Office.Interop.Outlook.MailItem msgItem;

// Open Mail file
msgItem =
(Microsoft.Office.Interop.Outlook.MailItem)objOutlook.CreateItemFromTemplate(path,nullobj);

// Extract Plain Text
string plainText = msgItem.Body.ToString();

// Cleanup Resources.
objOutlook.Quit();
objOutlook = null;

return plainText;

The application uses COM INTEROPS of Office XP, Office 2003 and Office 2007
to generate text files. First, the available version is checked and then uses
INTEROPS of that particular version to generate text files.

The application doesn’t need to access the Outlook application, because
users select a file available in the local file system using a file-open
dialog box.

We need to find a solution to stop appearing the pop-up warning so that
users don’t have to respond to the warning message.
Back to top
Display posts from previous:   
Post new topic   General Reply to Topic (not reply to a specific post)    Forums Home -> Interoperability All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum