Message Header

J

John Lane

How does one get at the message header programatically? I don't see a
property for it. Thanks.
 
E

Eric Legault [MVP - Outlook]

Are you talking about the Internet headers for an e-mail?

If so, you need to use CDO to read the value of PR_TRANSPORT_MESSAGE_HEADERS
from a Field object, or use Redemption (http://www.dimastr.com).

If you have Outlook 2007, you can use VBA:

Sub DemoPropertyAccessorGetProperty()
Dim PropName, Header As String
Dim oMail As Object
Dim oPA As Outlook.PropertyAccessor
'Get first item in the inbox
Set oMail = _
Application.Session.GetDefaultFolder(olFolderInbox).Items(1)
'PR_TRANSPORT_MESSAGE_HEADERS
PropName = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
'Obtain an instance of PropertyAccessor class
Set oPA = oMail.PropertyAccessor
'Call GetProperty
Header = oPA.GetProperty(PropName)
Debug.Print (Header)
End Sub
 
D

Dmitry Streblechenko

Read the PR_TRANSPORT_MESSAGE_HEADERS MAPI property using
1. Extended MAPI (C++/Ddelphi only)
2. CDO 1.21 (security prompt will be displayed)
3. Redemption (utl below).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Top