-->
http://www.msexchangefaq.de/code/olkvba.htm
eMail Header auslesen
Const PR_SENDER_EMAIL_ADDRESS = &HC1F001E
Const PR_TRANSPORT_MESSAGE_HEADERS = &H7D001E
Dim oSession As MAPI.SESSION, oFolder As MAPI.Folder, _
oMsgColl As MAPI.Messages, oMessage As MAPI.Message
' Logon to the MAPI session
Set oSession = New MAPI.SESSION
oSession.Logon
' Get the Inbox folder and its message collection.
Set oFolder = oSession.GetDefaultFolder(CdoDefaultFolderInbox)
Set oMsgColl = oFolder.Messages
For Each oMessage In oMsgColl
With oMessage
Debug.Print .Sender; ": "; .Subject
Debug.Print " "; .Fields(PR_SENDER_EMAIL_ADDRESS); _
", "; .Fields(PR_TRANSPORT_MESSAGE_HEADERS)
End With
Next
' Logoff
oSession.Logoff
Verweis auf die CDO-Library setzen.
Andere Variante:
Sub PrintMailWithHeader()
Const PR_TRANSPORT_MESSAGE_HEADERS = &H7D001E ' Feldkonstante
für Mailheader
Dim objSafeMailItem As Object
Dim objMail As Outlook.MailItem
Dim strHeader As String
Dim strBody As String
Set objSafeMailItem = New Redemption.SafeMailItem
Set objMail = ActiveExplorer.Selection(1)
Set objSafeMailItem.Item = objMail
strHeader = objSafeMailItem.Fields(PR_TRANSPORT_MESSAGE_HEADERS)
With objMail
strBody = .HTMLBody
.HTMLBody = "[Internetheader - Beginn]<br/>" & _
strHeader & vbCrLf & "[Internetheader - Ende]" & .HTMLBody
.PrintOut
.HTMLBody = strBody
.Save
End With
Set objSafeMailItem = Nothing
End Sub
Verwenden Sie die Redemption von
www.dimastr.com/redemption/home.htm für diesen Code.
Code für MailArchiv
http://www.office-loesung.de/ftopic265084_0_0_asc.php
Informationen über die PR_ codes
http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefattributetag.aspx
Auslesen der Mail x Header
http://www.wer-weiss-was.de/theme161/article4690019.html
|