C#, Outlook, and a nasty error

  • Thread starter Thread starter techprot-google04
  • Start date Start date
T

techprot-google04

Who's asking this question:
1. A newbie.
2. This is my second C# program.
3. I've done VB programming in the past.
4. I'm rusty on OOP - usually where I trip up.

Here's what I want to do:
1. Create a task in Outlook from within my program.

I'm using this as a reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/ol03csharp.asp

Doing basic stuff the referenced article, I've started by adding this
code:
// Create an Outlook Application object.
Application outLookApp = new Application();

And I get this error (on the line above):
C:\...\Form1.cs(804): 'System.Windows.Forms.Application.Application()'
is inaccessible due to its protection level
Any ideas on what I'm doing wrong?
 
Who's asking this question:
1. A newbie.
2. This is my second C# program.
3. I've done VB programming in the past.
4. I'm rusty on OOP - usually where I trip up.

Here's what I want to do:
1. Create a task in Outlook from within my program.

I'm using this as a reference:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/ol03csharp.asp

Doing basic stuff the referenced article, I've started by adding this
code:
// Create an Outlook Application object.
Application outLookApp = new Application();

And I get this error (on the line above):
C:\...\Form1.cs(804): 'System.Windows.Forms.Application.Application()'
is inaccessible due to its protection level
Any ideas on what I'm doing wrong?

To avoid the class name collision use the full namespace name. Ex:

Microsoft.Office.Interop.Outlook.Application outlook = new
ApplicationClass();
 
Back
Top