Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Internet Message Headers in Outlook VBA

154 views
Skip to first unread message

Tracy Flynn

unread,
Jan 7, 2001, 7:18:41 AM1/7/01
to
Hello,

My overall goal is to be able to save the full text (in text form), including
all 'Internet Headers', of messages in Outlook 2000. I want to do some (fancy)
text processing, including message threading external to Outlook.

More specifically, I can view the 'Internet headers' for a message - with a
message displayed in separate message window (not preview pane) View!Options.
That windows shows, among other things, a 'In-Reply-To' field (when present) that
looks like:

'In-Reply-To: <B67A5448.17CD%ad...@att.net>'.

This uniquely identifies the message to which this message is a reply. Since all
messages themselves have unique IDs, that then gives me a clean, unambiguous way
to build a chain of related messages.

When I use 'Save as', I only get the standard headers:

From, To, Sent, Subject, cc, Bcc and so on.

I've been through the VBA Property reference and can't find a direct way to
access the 'In-Reply-To' field.

Alternatively, I would settle for the raw - i.e. uninterpreted or with all
headers - text of the entire message.

Can anyone shed any light on this?

Thanks in advance,

Tracy

Neo [MVP Outlook]

unread,
Jan 7, 2001, 1:00:17 PM1/7/01
to
The internet header isn't exposed to the Outlook object model. Instead. try
using Collaboration Data Objects 1.21 to retrieve the Internet Header of a
message.

Sub GetMAPIFields()
Dim objCDO As MAPI.Session
Dim objMsg As MAPI.Message
Dim objSender As MAPI.AddressEntry
Dim oMsg As Outlook.MailItem
Dim oFields As MAPI.Fields
Dim oField As MAPI.Field
On Error Resume Next
Set oMsg = Application.ActiveExplorer.Selection.Item(1)
Set objCDO = CreateObject("MAPI.Session")
objCDO.Logon "", "", False, False
Set objMsg = objCDO.GetMessage(oMsg.EntryID)
Set oFields = objMsg.Fields
Debug.Print oFields.Item(&H7D001E).Value
End Sub

--
Neo [MVP-Outlook]

Are you considering installing the Email Security Patch or Office 2000
Service Pack 2?
Read this page first and consider your choice carefully if you depend on
accessing specific attachments or have programs that need access to
Outlook's address book.
http://www.slipstick.com/outlook/esecup.htm

"Tracy Flynn" <tracy...@ima-gnu.com> wrote in message
news:480d01c078a3$f8d78490$46862ecf@cpmsftngxa06...

Buck

unread,
Jan 10, 2001, 4:54:21 PM1/10/01
to
I wrote a macro for myself to do this. It pops up a neat little window
which allows me to mark it as spam (catergory) and copy the contents to the
clipboard.

I have posted it on my website. Here is the direct link:
http://www.artiztik.com/artiztik/freeware.html#ms

It's free, the instructions on how to install are there, and the macro will
be available for your own personal changes.

--
George "Buck" Paiva


"Tracy Flynn" <tracy...@ima-gnu.com> wrote in message
news:480d01c078a3$f8d78490$46862ecf@cpmsftngxa06...

0 new messages