n00b question here. I am an MS-Office 2007 user, and am using Win32::OLE. I have an outlook email in HTML format as specified here:

#start Outlook and make it visible my $Outlook = Win32::OLE->GetActiveObject ('Outlook.Application') || Win32::OLE->new('Outlook.Application'); $Outlook->{'Visible'} = 1; my $message = $Outlook->CreateItem(olMailItem); $message->{BodyFormat} = 'olFormatHTML'; #needed for rich format #use a hash to populate address and subject fields $message->{HTMLBody} = $emailBody; my $clip = Win32::Clipboard($message->{HTMLBody});

If I manually copy and paste my email body from Outlook to Word, it copies fine, resulting in RTF in Word. Programatically though (see code snippet above), it seems to be copying straight HTML code to the clipboard. Then when pasted to Word, it comes out as HTML code, not the RTF I desire. How can i programatically copy and paste from the Outlook email body to Word so that it ends up as rich text?

In reply to Re^2: Win32::OLE - copying and pasting outlook body and pasting to Word by tallwithblueeyes
in thread Win32::OLE - copying and pasting outlook body and pasting to Word by tallwithblueeyes

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.