C#, Outlook, and a nasty error

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?
 
T

Tom Porterfield

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();
 

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