G
Guest
Hello 
I would like to use Outlook 2003 in my application so for that, i've added
the referece to Outlook 11.0 Object Model to my project.
Then, I try this simple code :
using System;
using Microsoft.Office.Interop.Outlook;
namespace ConsoleApplication1
{
/// <summary>
/// Description résumée de Class1.
/// </summary>
class Class1
{
/// <summary>
/// Point d'entrée principal de l'application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
// Create an Outlook Application object.
ApplicationClass outLookApp = new ApplicationClass();
// Create a new TaskItem.
TaskItem newTask =
(TaskItem)outLookApp.CreateItem(OlItemType.olTaskItem);
// Configure the task at hand and save it.
newTask.Body = "Don't forget to send DOM the links...";
newTask.DueDate = DateTime.Now;
newTask.Importance = OlImportance.olImportanceHigh;
newTask.Subject = "Get DOM to stop bugging me.";
//newTask.Save();
}
catch(System.Exception ex)
{
Console.WriteLine("Exception catched. Message: " + ex.Message);
Console.WriteLine("Stack trace:\n" + ex.StackTrace);
Console.ReadLine();
}
}
}
}
But every time, an exception is catched on the first line:
ApplicationClass outLookApp = new ApplicationClass();
Here is the result of the exception:
Exception catched. Message: The specified module could not be found.
And the stack trace is :
Stack trace:
at ConsoleApplication1.Class1.Main(String[] args) in c:\documents and
setting
s\tom\mes documents\visual studio
projects\consoleapplication1\class1.cs:line 20
I've tried to repair Office without results.
I don't understand becasue i've aloready tried and code like this (on
Outlook 2000) and it worked fine. Now, on Outlook 2003, it doesn't work...
Any ideas ?
Thank You.

I would like to use Outlook 2003 in my application so for that, i've added
the referece to Outlook 11.0 Object Model to my project.
Then, I try this simple code :
using System;
using Microsoft.Office.Interop.Outlook;
namespace ConsoleApplication1
{
/// <summary>
/// Description résumée de Class1.
/// </summary>
class Class1
{
/// <summary>
/// Point d'entrée principal de l'application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
try
{
// Create an Outlook Application object.
ApplicationClass outLookApp = new ApplicationClass();
// Create a new TaskItem.
TaskItem newTask =
(TaskItem)outLookApp.CreateItem(OlItemType.olTaskItem);
// Configure the task at hand and save it.
newTask.Body = "Don't forget to send DOM the links...";
newTask.DueDate = DateTime.Now;
newTask.Importance = OlImportance.olImportanceHigh;
newTask.Subject = "Get DOM to stop bugging me.";
//newTask.Save();
}
catch(System.Exception ex)
{
Console.WriteLine("Exception catched. Message: " + ex.Message);
Console.WriteLine("Stack trace:\n" + ex.StackTrace);
Console.ReadLine();
}
}
}
}
But every time, an exception is catched on the first line:
ApplicationClass outLookApp = new ApplicationClass();
Here is the result of the exception:
Exception catched. Message: The specified module could not be found.
And the stack trace is :
Stack trace:
at ConsoleApplication1.Class1.Main(String[] args) in c:\documents and
setting
s\tom\mes documents\visual studio
projects\consoleapplication1\class1.cs:line 20
I've tried to repair Office without results.
I don't understand becasue i've aloready tried and code like this (on
Outlook 2000) and it worked fine. Now, on Outlook 2003, it doesn't work...

Any ideas ?
Thank You.