You'd need to extract everything you want such as item.Subject, item.To,
etc. If you intend to do this often you probably should design a Word
template and open that to fill in bookmarks or fields with the data from
Outlook. That way you get a consistent look to the output. There isn't any
method that will do any rendering for you, just use of the Word object
model.
Internet mail headers aren't exposed in the Outlook object model, even in
Outlook 2007. For Outlook 2007 you could use the item.PropertyAccessor
object with the DASL property tag
"http://schemas.microsoft.com/mapi/proptag/0x007D001E" (a DASL tag, not an
URL) to get the entire header property (PR_TRANSPORT_MESSAGE_HEADERS) as a
string, but you'd need to parse each line of that string to extract
individual headers.
In earlier versions of Outlook where PropertyAccessor isn't available you'd
have to use a different API such as Extended MAPI (C++ or Delphi, unmanaged
code only) or CDO 1.21 (optional installation and subject to security) or
Redemption (
www.dimastr.com/redemption) to get the Internet headers.
"amh" <amh.4b76f5e@outlookbanter.com> wrote in message
news:amh.4b76f5e@outlookbanter.com...
> That's a good idea to print using word - thanks. The only problem I'm
> running into now is that I want it to look as close as possible to how
> it looks if I print from outlook.
> How do I get the email content, including the to, from and subject to
> copy over to a word document? Right now I can get the text of the
> email by using the mailitem.body and I can write what I need to the
> word headers and footers but I'm missing how to get the email header
> info. I know I can get the recipients, subject, etc. one by one but is
> there a way to get the whole thing as one, or is there a method that I
> missing that will render the email and then I can copy and insert into
> word?