Quantcast
Channel: Outlook IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 33562

Outlook 2007 VBA Create and Apply Filter not displaying items

$
0
0

Hi all, I have developed a simple userform to display a listbox of categories. The idea is that as soon as a value in the listbox is selected the current folder has a Table View created called "Filtered" with the selected value as the Category filter set.

Everything works fine except when the filter is applied no items are shown (even though they clearly exist).

Can anyone spot my error?? Thanks in advance.

Private Sub lstCategories_Click()
    'Create Filtered view
    Set olView = olFldr.Views.Add("Filtered", olTableView, olViewSaveOptionAllFoldersOfType)
    olView.Filter = modOutlook.Quote("urn:schemas-microsoft-com:office:office#keywords") & " LIKE '%" & lstCategories.Value & "%'"
    olView.Save
    olView.Apply
End Sub


I get the View created and the Filter value shows DASL Filter and when I go to the Filter dialog box and SQL tab the value is...   "urn:schemas-microsoft-com:office:office#keywords" LIKE '%Holiday%'

I should also note that the Edit these criteria directly... checkbox is selected.

Viewing all articles
Browse latest Browse all 33562

Trending Articles