I have, I hesitate somewhat to admit, written some similar code myself (hesitation due to general dislike of MSFT APIs), so I will try to answer, though I don't have a Windows box here to verify the code on.

If Outlook is already running, this code will work without any username or poassword prompts. If not, running the program will cause Outlook to automagically start and present the username/password prompt in its ordinary way.

The line you quote creates a new instance of an object that one uses, through OLE, to interact with Outlook programmatically. It will indeed start Outlook for you if it is not already running.

The rest of the code is just the usual code for opening a mailbox in Outlook. The strange method and argument names are simply a reflection of the way MAPI data sources are structured. You can find a VB equivalent of that code fairly easily by searching around the 'net, though Perl is a less common choice for this sort of thing (but I presume it works fine).


In reply to Re^3: How to find when a new email arrives in my mailbox (outlook) by Errto
in thread How to find when a new email arrives in my mailbox (outlook) by gpurusho

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.