Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Filter(?) for Win32 OLE Find method

by tcf22 (Priest)
on Aug 06, 2003 at 16:17 UTC ( #281467=note: print w/replies, xml ) Need Help??


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

This is the best I could come up with. I can't find anyway except for looping through the messages.

Also make sure to import the in method, because it isn't imported by default.
#! /usr/bin/perl use strict; use warnings; use Win32::OLE qw( in ); #Outlook Application creation my $outlook = Win32::OLE->CreateObject('Outlook.Application'); my $ns = $outlook->getNamespace('MAPI'); my $inbox = $ns->GetDefaultFolder(6); #String to match my $match_str = 'test'; #Search the items foreach my $item (in $inbox->Items){ if($item->{Subject} =~ /^$match_str/i){ print "$item->{Subject} matches\n"; } }

Replies are listed 'Best First'.
Re: Re: Filter(?) for Win32 OLE Find method
by banduwgs (Beadle) on Aug 06, 2003 at 17:13 UTC

    Yes this is fine, but I don't like much looping through all items :-(. "Find" method seems fairly optimize on this perspective. It suports searching portions of string in VB scripts. That's why I thought that there should be a way to activate it in Perl as well

    Thanks a lot for your attention. Do you or any others... further comments please?? - SB

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2021-03-02 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (42 votes). Check out past polls.

    Notices?