Open Outlook COM from Windows Service

J

JJ

Hello NG

I want to create a windows service using C#.
In that service i want to open access to Outlook COM object but nothing
happens.

I've sat a reference to the Microsoft Outlook component verison 12 and using
the following:

Microsoft.Office.Interop.Outlook.Application objOL = New
Microsoft.Office.Interop.Outlook.Application();

And the servcice don't get any further. It don't creates any errors or
messages but i can't se that i continue to next line of code?

Is it not possible to open Outlook COM object from a windows service?



Kind regards

Johnny E. Jensen
 
A

Alberto Poblacion

JJ said:
I want to create a windows service using C#.
In that service i want to open access to Outlook COM object but nothing
happens.

I've sat a reference to the Microsoft Outlook component verison 12 and
using
the following:

Microsoft.Office.Interop.Outlook.Application objOL = New
Microsoft.Office.Interop.Outlook.Application();

And the servcice don't get any further. It don't creates any errors or
messages but i can't se that i continue to next line of code?

Is it not possible to open Outlook COM object from a windows service?

Be aware that the first time that a new user opens Outlook, it shows a
window that asks for some initial configuration. If the service is running
with the credentials of a user that has never before opened Outlook, then
the service will be trying to display that window, but you will not see it
because the service does not have access to the Desktop, and therefore it
will just "hang" there.
 
M

Miha Majcen

Hi Johnny!

It's possible to open Outlook COM object from a windows service, but
you have to run service as a user(computerName/username) , not as a
SYSTEM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top