Hi!
Sorry to disappoint you but I found a solution...
I had to add some code...
Microsoft.Office.Interop.Outlook.ApplicationClass outLook = new
Microsoft.Office.Interop.Outlook.ApplicationClass();
Microsoft.Office.Interop.Outlook.NameSpace nameSpace = outLook.Session;
//This makes it work, I need a session since no Outlook session are open.
The last true is the new session parameter
nameSpace.Logon(Type.Missing, Type.Missing, false, true);
Here is the link to the MSDN documentation...
http://msdn.microsoft.com/en-us/library/bb219914.aspx
Thanks for your effort but you miss the answer...
ShrimpBoy
"Sue Mosher [MVP]" wrote:
> Outlook is not suitable to automate from a server or a scheduled task. See
> http://support.microsoft.com/kb/257757/ for more information on this issue.
>
> Each version of Exchange has its own best automation solutions. The
> microsoft.public.exchange.development newsgroup or the forum at
> http://forums.microsoft.com/TechNet/...=838&SiteID=17
> should be able to help you determine what server-based solution would be best
> for your particular environment.
> --
> Sue Mosher, Outlook MVP
> Author of Microsoft Outlook 2007 Programming:
> Jumpstart for Power Users and Administrators
> http://www.outlookcode.com/article.aspx?id=54
>
>
> "ShrimpBoy" wrote:
>
> > Hi!
> >
> > I have a generic user on our AD that have a mailbox and this user receive an
> > email every morning...
> >
> > I created an application with Microsoft Office 2007 PIA and Visual Studio
> > 2005.
> >
> >
> >
> > The application get the email from today, parse it and create an excel file
> > with it..
> >
> > I first received a warning but I disabled the warning message in the trust
> > center of Outlook 2007 (Allow, Deny, Help)...
> >
> > Now I have no warning and when logged as my generic user everything works...
> >
> > I created a scheduled task on the server to run my application as the
> > generic user but it doesn't work... it keeps running but I don't see any
> > thing done...
> >
> > Outlook.exe process consume 0% of the CPU...
> >
> > How can I make this task works?
> >
> > Thanks!