Thanks for the reply Stuart. I had already registered the PIAs in the GAC as
instructed by the download readme file.
I'm not sure how many of these are necessary to create an
Outlook.ApplicationClass, but my GAC shows the following all pointing to the
PIA folder:
Microsoft.Office.Interop.Outlook
Office
stdole
Here is the entire code my my project:
using System;
using Microsoft.Office.Interop.Outlook;
namespace OutlookTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Microsoft.Office.Interop.Outlook.Application golApp;
Microsoft.Office.Interop.Outlook.NameSpace gnspNameSpace;
golApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();
gnspNameSpace = golApp.GetNamespace("MAPI"); // Exception thrown here
Console.WriteLine("Success");
}
}
}
> Jeff,
>
> Ensure that the Office XP PIA's are installed into the GAC. Microsoft has strongly named the PIA's and marked them as the primary interop assemblies.
This ensures that Office objects can be shared between different
applications using the same identity.