Glorius Brothers and Sisters....

I'm working on a script that will allow Users to open and view an Outlook .msg file. MS Outlook and Outlook Express allow Users to to drag and drop an email to a directory and create a .msg file that contains the email and any attachments. The publishing company where I work has decided that this small file will form the basis of an ad tracking system, for better or worse. Currently the management of these files is completely manual. The current script will form part of a larger Perl App that will provide some automation and tracking.

I've tried using Win32::Process to open the file in Outlook Express but without luck. The sample code is below. I can launch OE fine, the file itself will not open however. It will open if I just double click the file sitting on the desktop it so I know OE is able to view it.

I've also tried Win32::OLE. Regrettably it's not working. The goal here is to simply open the .msg file for viewing in Outlook. I do not require data from the email itself.

Any thoughts or hints would be appreciated.

I am using ActiveState Perl 5.8.7 on Windows XP. The solution will have to work on both XP and Win2000.

#Win32::Process sample sub ViewEmail{ my $Path = "c:\\documents and settings\\p court\\desktop"; my $Outlook = "c:\\program files\\Outlook Express\\MSIMN.exe"; my $ProcessObj; my $file = "VolleyballBC"; if($Outlook){ chdir $Path; Win32::Process::Create( $ProcessObj, $Outlook, "MSIMN $file", 1, NORMAL_PRIORITY_CLASS, ".") || die ! "no can do"; } $ProcessObj->Suspend(); $ProcessObj->Resume(); }

In reply to Outlook Express & Perl by philc

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.