can't create a search folder in a PST

B

Benjamin Strautin

I have a regular Exchange mailbox and several PST files, and am able to use
the GUI to create working search folders for both the mailbox and the PSTs.
I can also use the Search object's Save method to create a search folder in
my Exchange mailbox. However, when I try to use Search.Save in a PST, I get
this error:

Run-time error '-2147221241 (80040107)':

The operation failed. An object could not be found.


' This code works: ("Mailbox - Strautin, Benjamin" is my mailbox)
strFolder = "'\\Mailbox - Strautin, Benjamin'"
strSearch = """urn:schemas:httpmail:subject"" like '%foo%'"
Application.AdvancedSearch(strFolder, strSearch).Save "foo"

' This code fails: ("Archive Folders" is a PST)
strFolder = "'\\Archive Folders'"
strSearch = """urn:schemas:httpmail:subject"" like '%foo%'"
Application.AdvancedSearch(strFolder, strSearch).Save "foo"
 

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

Top