![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#8
|
|||
|
|||
![]()
Beta 2
does not error out, but the filter does not seem to work note: messages exist in the Inbox that wd match filter criteria ? FindMessages() 562 unfiltered @SQL="urn:schemas:httpmail:Subject" CI_PHRASEMATCH 'Flight' 0 filtered Public Function FindMessages() Const QT As String = """" On Error GoTo HandleErr Dim olapp As Outlook.Application Dim olns As Outlook.NameSpace Dim olfldr As Outlook.Folder Dim olmi As Outlook.MailItem Dim olitms As Outlook.Items Dim matchedItems As Outlook.Items Dim strFilter As String Set olapp = New Outlook.Application Set olns = olapp.GetNamespace("MAPI") Set olfldr = olns.GetDefaultFolder(olFolderInbox) Set olitms = olfldr.Items '===== available fields =====' 'attachmentfilename 'httpmail -BCC 'httpmail -CC 'content-disposition-type 'content-media-type 'httpmail -Date 'datereceived 'httpmail -From 'HasAttachment 'htmldescription 'Importance 'normalizedsubject 'Priority 'httpmail-reply-to 'Sender 'Subject 'textdescription 'thread -topic 'to '===== Keywords =====' 'CI_STARTSWITH 'CI_PHRASEMATCH 'strFilter = "@SQL=" & QT & "urn:schemas:httpmail:HasAttachment" & QT & " = 1" strFilter = "@SQL=" & QT & "urn:schemas:httpmail:Subject" & QT & " CI_PHRASEMATCH 'Flight'" Debug.Print olitms.Count & " unfiltered" Debug.Print strFilter Set matchedItems = olitms.Restrict(strFilter) Debug.Print matchedItems.Count & " filtered" Exit_He On Error Resume Next Set matchedItems = Nothing Set olitms = Nothing Set olfldr = Nothing Set olns = Nothing Set olapp = Nothing Exit Function HandleErr: Debug.Print "Error Number " & Err.Number & ": " & Err.Description Resume Exit_He End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook Automation Automation Problem Out of Memory | MikeA[_2_] | Outlook and VBA | 7 | July 30th 07 02:31 PM |
Problem with Outlook Automation | Neil | Outlook and VBA | 13 | January 15th 07 07:09 AM |
Outlook Automation | Tylendal | Outlook and VBA | 3 | April 24th 06 02:39 PM |
Outlook automation using vbs | Marceepoo | Outlook - Installation | 1 | January 17th 06 04:18 AM |
Help on Outlook automation | Neo | Outlook - General Queries | 1 | January 15th 06 04:49 PM |