Access Outlook's Page Header and Footer

A

amh

I have a requirement to have specific data that's stored in a use
property be displayed in the header and footer for printing purposes.

The only way I can think of doing this is by setting the Header/Foote
in the overall Outlook Page Setup, but I can't access those through th
inspector. Can this be done?

I know that if I'm able to do this via code, it will apply to al
emails but I'm hoping to blank it out after the email is printed.

Any help is appreciated
 
K

Ken Slovak - [MVP - Outlook]

I think to do what you want you will need to print to Word or some other
application that provides access to print setup and headers and footers.
Outlook doesn't provide any of that.
 
A

amh

That's a good idea to print using word - thanks. The only problem I'
running into now is that I want it to look as close as possible to ho
it looks if I print from outlook.

How do I get the email content, including the to, from and subject t
copy over to a word document? Right now I can get the text of th
email by using the mailitem.body and I can write what I need to th
word headers and footers but I'm missing how to get the email heade
info. I know I can get the recipients, subject, etc. one by one but i
there a way to get the whole thing as one, or is there a method that
missing that will render the email and then I can copy and insert int
word?

'Ken Slovak - [MVP - Outlook said:
;316619']I think to do what you want you will need to print to Word o
some other
application that provides access to print setup and headers an
footers.
Outlook doesn't provide any of that.




"amh" (e-mail address removed) wrote in message

I have a requirement to have specific data that's stored in a user
property be displayed in the header and footer for printing purposes.

The only way I can think of doing this is by setting th
Header/Footer
in the overall Outlook Page Setup, but I can't access those throug
the
inspector. Can this be done?

I know that if I'm able to do this via code, it will apply to all
emails but I'm hoping to blank it out after the email is printed.

Any help is appreciated.
 
K

Ken Slovak - [MVP - Outlook]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top