Application.AdvancedSearch - namespace for Categories?

  • Thread starter Thread starter dawolfden
  • Start date Start date
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:office:office#Category but
this does nothing:

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

Any idea what the filter string would be to select on a specific
category?
 
Use "urn:schemas-microsoft-com:office:office#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.
 
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:office:office#Keywords LIKE '%/"
& sqf & "/%'"

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

Does that look right?
 
I'd probably do it something like this:

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

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