
How to get header information of recieved letter in outlook express
Here is a function that I've used to report spam. The part that you
may be able to use is the retrieving of the headers. As far as I've
been able to tell, these are not exposed by the Outlook Object model,
so you have to use CDO to get at them with the message ID.
Hope this helps,
Troy
Const CdoPR_TRANSPORT_MESSAGE_HEADERS = &H7D001E
Sub ReportSpam
Dim oApp As Outlook.Application
Dim oExplorer As Explorer
Dim oExplorers As Explorer
Dim oInspector As Inspector
Dim oMailItem As MailItem
Dim oBodyFormat As Outlook.OlBodyFormat
Dim sEntryID As String
Set oApp = Application
Set oExplorer = oApp.ActiveExplorer
If TypeName(oExplorer) <> "nothing" Then
Set oMailItem = oExplorer.Selection.Item(1)
oBodyFormat = oMailItem.BodyFormat
sBody = oMailItem.Body
sEntryID = oMailItem.EntryID
'Need to use CDO session to get the internet headers
Set oSession = CreateObject("Mapi.Session")
oSession.Logon "", "", False, False
'Get the open email message
Set oMessage = oSession.GetMessage(sEntryID)
sHeaders = oMessage.Fields(CdoPR_TRANSPORT_MESSAGE_HEADERS)
oMailItem.Forward
oMailItem.Body = sHeaders & vbCrLf & sBody
oMailItem.Send
End If
End Sub
End Sub
On Sat, 26 Oct 2002 00:44:39 -0700, "Jo-hsien Teng"
Quote:
>My friend want tracking mail forwarded by her ( the mail
>is forwarded to the company sales ) .
>How could I make a button on the outlook express toolsbar,
>the button help her get mail header info , analyzing
>header and message body , then store all the info. to
>access db or excel file ??
>What doc. or knowledge shoud i know about above case !!