Q

Error message: Couldn't complete operation because the service provided doesn't support it

My machine is running on Win2000 Professional and I have MS Outlook 97. I am trying to send mails through VB.NET code. For this, I have added a Reference to MS Outlook 8.0 Object library.

After doing, this when I run the patch below, it gives this error message:

"Couldn't complete operation because the service provided doesn't support it"

objOutlook = New Outlook.Application() 
  objNamespace = objOutlook.GetNamespace(Type:="MAPI") 
  objMAPIFolder = 
objNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)

This is a hard place to try and answer questions like this. From what you've sent, your code should work with the *current* version of Outlook and the most recent object interface (which is version 10, BTW). The issue here is not a .NET issue but instead a plain-old pain in the derriere bits-n-bytes debugging issue. A couple of things to help you narrow down your debugging.

1) Exactly which activity is causing the error to be generated (which line and which operation)?
2) Does the equivalent VB6 code execute properly on your machine?
3) Do you have to stick with a six year old client?

If you can upgrade your client to 2000 or 2002, then I'd recommend that first. If you're stuck supporting the 97 client, then Narrow down exactly which operation is causing you grief. It's possible that the version of the object API does not support one of the operations or types that you specify (though you are doing pretty generic stuff!). I don't have access to an object library from two versions back so I can't help much here.

The other class of problem that you may have is that something is "out of whack". The solution is to re-whack things. Specifically, your O97 installation my be corrupted somehow. You could try reinstalling the outlook client if you still have access to the installation media. Another possibility is that one of the generated files is messed up. You can delete the assemblies generated for Outlook, remove the reference from your project and regenerate them. It's unlikely that this will matter much, however. Pay close attention to make sure that the type library that the generator is cranking on is the expected version.

Sorry that I don't have a better answer here.
This was first published in December 2002

Dig deeper on Service-oriented architecture (SOA) implementations

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close