View Single Post
  #2  
Old March 13th 08, 10:00 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 1,528
Default Error "The operation failed" occurs only when Outlook is closed.

Do you have something loke the following befor you execute that code?

set NS = objOutlook.GetNamespace("MAPI")
NS.Logon

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Dugutigi" wrote in message
...
I'm using Visual Basic to create and send a message thru Outlook 2003. It
has worked perfectly for over a year at multiple sites, and works whether
or
not the user has Outlook open.

However, I have one site where an error occurs only if Outlook is closed.
If Outlook is open, the message is sent just fine. If Outlook is closed,
the
user recieves an error message "The operation failed" upon execution of
the
following line:

Set objOutlookMailItem = objOutlook.CreateItem(olMailItem)

This is very perplexing because it is only happening at one of over 100
sites. Any help will be greatly appreciated. Thanks.



Ads
 

Northern Rock - Problem Mortgage - Tax - Personal Loans - Credit Card Debt Consolidation