Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Filter(?) for Win32 OLE Find method

by cacharbe (Curate)
on Aug 06, 2003 at 17:50 UTC ( [id://281522]=note: print w/replies, xml ) Need Help??


in reply to Filter(?) for Win32 OLE Find method

This isn't a true DASL filter, so you end up having to use ranges, in a sense. Unfortunately, you can't use Contains, DoesNotContain, etc. from the filter object reference, as you would with the Search objects. It's a little different.

The following will help you find a range of subjects all between 'test' and 'tz':

use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Outlook'; $|++; $Win32::OLE::Warn = 3; my $OL = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit'); my $NameSpace = $OL->GetNameSpace("MAPI"); my $Folder = $NameSpace->GetDefaultFolder(olFolderInbox); my $Items = $Folder->{Items}; my $findtext = '[Subject] > "test" and [Subject] < "tz"'; my $MailItems = $Items->Find($findtext); while (1) { print $MailItems->{Subject} ."\n"; $MailItems = $Items->FindNext() || last; }
And one should note the following (from the Outlook VB Reference):
Comparison operators allowed within the filter expression include >,<, +<=, >=,= and <>. Logical operators allowed are And Not and Or
Update: Slight modification to search string and Text from Find Object Reference.

C-.

---
Flex the Geek

Replies are listed 'Best First'.
Re: Re: Filter(?) for Win32 OLE Find method
by banduwgs (Beadle) on Aug 07, 2003 at 08:06 UTC
    Thank you very much for the clarification. It's really helpful - SB

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://281522]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (1)
As of 2024-04-24 14:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found