Application.AdvancedSearch - namespace for Categories?

D

dawolfden

I'm modifying a VBA script which creates searchfolders from a
user-defined label to categories. I thought the namespace for that
filter would be urn:schemas-microsoft-com:blush:ffice:blush:ffice#Category but
this does nothing:

strFilter = "urn:schemas-microsoft-com:blush:ffice:blush:ffice#Category LIKE '%/"
& sqf & "/%'"

Any idea what the filter string would be to select on a specific
category?
 
K

Ken Slovak - [MVP - Outlook]

Use "urn:schemas-microsoft-com:blush:ffice:blush:ffice#Keywords".

The easiest trick to getting the property tag you need to use is by using
the customize current view dialog and the Filter button. In that dialog you
can set up your filter in the Advanced tab and then look at what was
generated in the SQL tab.
 
W

Westbroek

Thanks Ken, excellent tip!

I must be off somewhere still. Using the following the searchfolder gets
created but returns no messages:

strFilter = "urn:schemas-microsoft-com:blush:ffice:blush:ffice#Keywords LIKE '%/"
& sqf & "/%'"

Set objSrch = Application.AdvancedSearch(strScope, strFilter, True,
strTag)

Does that look right?
 
K

Ken Slovak - [MVP - Outlook]

I'd probably do it something like this:

strFilter = Chr(34) & "urn:schemas-microsoft-com:blush:ffice:blush:ffice#Keywords"
& Chr(34)
strFilter = strFilter & " LIKE '%/" & sqf & "/%'"

Your category is "/sqf/", where sqf is the value of that variable?
 

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