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

Hi--

I'm trying to use Perl to process some Outlook messages, but I need to insure they are done in date-received order. I saw this posting to do it in VB (http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/OLE~COM~ADO~CDO~ADSI~LDAP/OLE~and~Outlook+Sort~Email~by~Received~Time.txt), but can't seem to get the syntax quite right:

VB:  objItems.Sort("[ReceivedTime]", @True);

How do I express the <"ReceivedTime"> and <@True> parameters in Perl?

Perl:  $objItems->Sort{???, ???};

I'm not a whiz with VB in the least.

Thanks in advance.

Replies are listed 'Best First'.
Re: OLE syntax question
by Corion (Patriarch) on Aug 26, 2014 at 19:43 UTC

    Your Perl syntax is highly unlikely to work, or even compile.

    Most likely you want

    $objItems->Sort( "[ReceivedTime]", 1 );

    If the function really, really wants a VT_BOOLEAN as its second parameter, you will have to create the appropriate Win32::OLE::Variant object.

      Works like a charm!

      Thanks!