Gerry,
You might want to use CreateObject in C# as well, through the
Microsoft.VisualBasic library. You could set a reference to
Microsoft.VisualBasic and then access the static CreateObject method through
the Interaction class in the Microsoft.VisualBasic namespace. This should
give you the same results.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mvp@spam.guard.caspershouse.com
"Gerry" <gerry.van.den.broek@logicacmg.com> wrote in message
news:49f5b133.0310280338.70cbd10b@posting.google.c om...[color=blue]
> I am writing a program in C# which accesses data from Exchange. Code
> snippets have been copied from a VB-program.
>
> The VB-program does the following:
>
> 'create session and logon
> objSession = CreateObject("MAPI.Session")
>
> After this, everyhing works fine.
>
> In c# this looks like:
>
> 'create session and logon
> objSession = new MAPI.Session();
>
> And this does not work!?!? I get an error stating that Outlook is not
> the default client or that the mail client cannot fullfil the
> messaging request. Then i also get an exception: ClassFactory cannot
> supply requested class.
>
> Can anyone help me on this one? Everything concentrates on the
> creation of the session object. In VB.NET it works, in C# not?[/color]