views:

51

answers:

5

For one project reason I want to make my Microsoft Outlook Application to run as a service meaning that when i log off my pc it doesn't close. Trying to achieve this I decided that maybe it can be easier to build a Windows Service that calls the outlook application to open in its onStart Method. Can anyone redirect me in the right path on how to call outlook application and opening the application if it is closed.

A: 

You are looking for the Process.Start(string path) call.

This will start the application you the way you want. Check the other overloads for better control of the startup.

I am not sure though that Outlook can work as a non interactive process.

Oded
COM automation might also be an option to do this.
0xA3
A: 

You could call

System.Diagnostics.Process.Start(pathtooutlook);

Vivek Bernard
+1  A: 

When you make an application run in some way it wasn't designed to run, you can find yourself in trouble. Be certain of whether Outlook supports running this way.

John Saunders
A: 

Instead of logging off you could use the Switch User command. That way your session will stay alive (and Outlook keeps running), your screen is locked and other users will have the ability to log on to the machine. This would be much simpler than implementing a service and would give you the same result (i.e. Outlook keeps running).

0xA3
A: 

as an alternative you could reference the outlook api/dlls from your service rather than trying to keep the ui open.

Noel Kennedy