Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems to excute service with Microsoft Outlook 11.0 Object Library

Status
Not open for further replies.

josemauricio

Programmer
Sep 2, 2003
65
BR
Hey, here I am again.

Now a problem another problem. I use outlook component on a windows service to send automatically. I use it because I need to store all the sent messages in the "Sent Messages" folder. I create a small desktop application to test it it works well. Then, I move the code to the service, built it and installed on my machine. When I start the service, the following error happens:

"The description for Event ID ( 2001 ) in Source ( Microsoft Office 11 ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Microsoft Office Outlook; ."

I've tried hard to find out what is the trouble in the internet, but I didn't find anythig yet.

So, if you konw somthing about it, let me know.
 
Here is the code to help you maybe help me.

Dim olApp As Outlook.Application = New Outlook.Application [red]<- problem happens here[/red]
Dim olNameSpace As Outlook._NameSpace = olApp.GetNamespace("MAPI")
Dim olMAPIFolder As Outlook.MAPIFolder = olNameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderSentMail)
Dim message As Outlook.MailItem = olApp.CreateItem(Outlook.OlItemType.olMailItem)

olNameSpace.Logon("", "", False, True)

message.To = mPara
message.Subject = mAssunto
message.HTMLBody = mTexto
message.SaveSentMessageFolder = olMAPIFolder
message.Send()
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top