Outlook AdvancedSearch crashing with COMException

  • Thread starter Thread starter msielski
  • Start date Start date
M

msielski

I am posting this here since I don't see an Outlook programming group
specific to .net but only VBA. Please let me know if I'll have better
luck posting elsewhere.

I am writing a VB.NET application that interfaces with Outlook 2003 via
Microsoft.Office.Interop.Outlook.dll. I am calling AdvancedSearch
which with some folder scopes works fine, but with others crashes with
an unhelpful error of:

System.Runtime.InteropServices.COMException (0xF9B7064F): The operation
failed.

Which is thrown at the call of AdvancedSearch.

If I specify a scope of Inbox or 'Inbox' it works fine and searches my
Inbox. If I search for a folder name that doesn't exist I get the
above mentioned error. If I search for any valid sub folder though, I
also get the same error. It makes no difference how I quote the folder
name or if I use the full path. Sometimes however, and I can't
determine what makes a difference, it works as it should. Any ideas
what this is? I can verify that my connection to outlook is fine since
I can read messages and folder contents, just search is failing.

Thank you for any suggestions..
- Matt
 
I seem to have solved this by specifying the full path beginning with
\\ such as:

'\\Personal Folders\Folder One\Folder Two'

- Matt
 
I seem to have solved this by specifying the full path beginning with
\\ such as:

'\\Personal Folders\Folder One\Folder Two'

Yes, Outlook is rather weird but it can be programmed OK.
 

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

Back
Top