Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Search Outlook E-mail by Subject and Sent (or Received) Time by today's date

by bpaen (Novice)
on Jan 20, 2003 at 05:31 UTC ( [id://228288]=perlquestion: print w/replies, xml ) Need Help??

bpaen has asked for the wisdom of the Perl Monks concerning the following question:

I have no problem to locate E-mails based on the Subject and Sender Name etc. However, I have a trouble to interpret the "ReceivedTime" field which is a part of search criteria. I would really appreciate if someone can help me on this.

Here is the code I used (thanks for the examples provided in this section!)
foreach my $item (in $Inbox->{Items}) print "=========================================================== \n" +; print "subject : ", $item->{Subject}, "\n", print "Sent by : ", $item->{SenderName}, "\n"; print "Received at: ", $item->{ReceivedTime}, " \n";

The result for "ReceivedTime" is:

Received at: Win32::OLE::Variant=SCALAR(0x1cb00cc)

20030120 : Edit by Corion: Added formatting

Replies are listed 'Best First'.
Re: Search Outlook E-mail by Subject and Sent (or Received) Time by today's date
by zakb (Pilgrim) on Jan 20, 2003 at 09:25 UTC

    Dates are usually returned via OLE as a Variant data type.

    You most likely need to do something like:

    use Win32::OLE::Variant; my $ole_date = $item->{ReceivedTime}; print $ole_date->Date('dd/MM/yyyy'), ' ', $ole_date->Time('HH:mm:ss'), "\n";

    Untested, but lifted from a piece of code which uses the SourceSafe OLE interface, so should work!

    Try Win32::OLE::Variant for more info.
      Thak you very much. It worked for me and I should read some documentation on Win32::OLE. (I just learned Perl on the fly less than a year ago.) Thanks again.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found