msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Trying to interact with Outlook from Windows Service

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
tregewitz



Joined: 13 Feb 2008
Posts: 1

PostPosted: Wed Feb 13, 2008 6:51 pm    Post subject: Trying to interact with Outlook from Windows Service Reply with quote

We created a Windows Service (c#) that runs on users' machines. It
interacts with the desktop to alert the user of certain events. I
would also like it to be able to interact with the user's Outlook to
populate an e-mail for them that they can edit and send. When the
service is running under my account, it works fine, but when I set it
to run as SYSTEM I get this error:

Exception Type: System.Runtime.InteropServices.COMException
ErrorCode: -2147221021
Message: Operation unavailable

I read in this article (http://support.microsoft.com/kb/288366/) that
you can configure Office applications to automatically run as the
Interactive Account using dcomcnfg, but there is no Application in
Dcomcnfg for Outlook. Is there a way to get this to work?

Thanks,
Tim

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Wed Feb 13, 2008 11:49 pm    Post subject: Re: Trying to interact with Outlook from Windows Service Reply with quote

The Outlook object model is not supported for use in a service. You really
don't want to do that.

Use something else like CDOSys (if that's supported for managed code).
You'll have to research that, I'm not familiar with CDOSys.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


wrote in message @e23g2000prf.googlegroups.com...
> We created a Windows Service (c#) that runs on users' machines. It
> interacts with the desktop to alert the user of certain events. I
> would also like it to be able to interact with the user's Outlook to
> populate an e-mail for them that they can edit and send. When the
> service is running under my account, it works fine, but when I set it
> to run as SYSTEM I get this error:
>
> Exception Type: System.Runtime.InteropServices.COMException
> ErrorCode: -2147221021
> Message: Operation unavailable
>
> I read in this article (http://support.microsoft.com/kb/288366/) that
> you can configure Office applications to automatically run as the
> Interactive Account using dcomcnfg, but there is no Application in
> Dcomcnfg for Outlook. Is there a way to get this to work?
>
> Thanks,
> Tim

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
How to quit running outlook application from service without Hi, we need to close any running outlook applications from a windows service in order to do backups of pst files. We used to do this using Automation from a normal app but now we need to do it from a windows service. I've learned from

how to show a "Path to Windows folder"-dialog ? How can I do that - show a "Path to Windows folder"- dialog ? I have tried to show a "FileSaveAs" but I get error 429 and it's NOT the right dialog to show - it should be a dialog where one can pick "a drive" and "a folder" on that drive. but how ? KS, De

Extract Windows user name and adding toolbar buttons? Hi. 1. Is it possible to extratc the user name used to logon to Windows and put it in a variable? 2. Is there a way that I can create my own buttons on the toolbar that will execute a macro/script of my choice? All help apprsiated... /Best regards Ola

Outlook ignoring html font tag - VBA - Access 2007 & Outlook Seeing another pair of eyes to tell me where I'm missing some key element. My code below works fine to create a message however the font tag is ignored and everything comes out as Times New Roman 12pt. Any assist would be greatly appreciated. strMailMsg

i made a plugin of outlook that crashes in outlook 2007 on v Hi I am facing a Problem that i have made a plugin in Visual Studio 2000 using VC6.0 that is running fine in outlook 2003 and on all the operating but when i run that plugin on Outlook2007 installed on Microsoft Vista( licensed )
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group