PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Scheduled Task for Outllok 2007...

 
 
ShrimpBoy
Guest
Posts: n/a
 
      10th Aug 2009
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!
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      12th Aug 2009
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!

 
Reply With Quote
 
 
 
 
ShrimpBoy
Guest
Posts: n/a
 
      12th Aug 2009
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!

 
Reply With Quote
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      12th Aug 2009
Just because you can call Namespace.Logon doesn't make your approach
supported. It is not guaranteed to work reliably, for reasons including those
in the article I suggested. If you want a reliable solution, you should take
a different approach.
--
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!
>
> 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.
> >
> > "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!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need info on scheduled meetings: time scheduled/who scheduled it Joe Bruin Microsoft Outlook Calendar 1 24th Mar 2010 08:36 PM
Scheduled task will not run as scheduled! alex.birchall@gmail.com Microsoft Windows 2000 1 3rd Dec 2009 11:48 AM
What happens if a scheduled task is scheduled to start, but theprevious task execution is still running? joe.carr@gmail.com Windows XP General 1 17th Dec 2007 08:32 PM
Add Scheduled Task wizard in Scheduled Tasks won't run =?Utf-8?B?U01GYWlzb24=?= Microsoft Windows 2000 4 12th May 2005 12:26 AM
On startup get failed to run scheduled task for user account, but there is no task scheduled! kifoghorn Windows XP Help 0 18th Apr 2005 07:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:54 PM.