About This Code
Brief Description:
Forward mail including mail headers
Contributor:
Andrew Jones
Last Modified:
17 Jun 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
'(Globals):
Option Public
Option Explicit
Option Base 0 'added
Use "CoreEmailClasses"
'Memo_with_Header:
Sub Querysave(Source As Notesuidocument, Continue As Variant)
'Call cMemoObject.QuerySave(Continue)
End Sub
Sub Postmodechange(Source As Notesuidocument)
'Call cMemoObject.PostModeChange()
End Sub
Sub Postopen(Source As Notesuidocument)
'***************************************************
'Unveils Mail Header Info ready to Forward
'by Wolfgang Flamme, 19.07.2001
'***************************************************
On Error Goto ErrorHandler
Dim docItem As NotesItem
Dim strDisplayThese(11) As String
Dim varDocItems As Variant
Dim strLinefeed As String, strLineInsert As String
Dim i As Integer
strDisplayThese$(0)={Received}
strDisplayThese$(1)={From}
strDisplayThese$(2)={X_Resent_From}
strDisplayThese$(3)={X_envelope_to}
strDisplayThese$(4)={SendTo}
strDisplayThese$(5)={Subject}
strDisplayThese$(6)={MIME_Version}
strDisplayThese$(7)={$Mailer}
strDisplayThese$(8)={$MessageID}
strDisplayThese$(9)={PostedDate}
strDisplayThese$(10)={$MIMETrack}
strDisplayThese$(11)={SMTPOriginator}
Set docThis=Source.Document
varDocItems=docThis.Items
strLinefeed$=Chr$(13) & Chr$(10)
Source.EditMode=True
For i%=Lbound(strDisplayThese()) To Ubound(strDisplayThese())
Forall varDocItem In varDocItems
Set docItem=varDocItem
If docItem.Name=strDisplayThese(i%) Then
strLineInsert$=strLinefeed$ & docItem.Name & ": " & Chr$(9) & docItem.Text
If Not(Instr(Source.FieldGetText({AllHeaders}), strLineInsert$)) > 0 Then
Call Source.FieldAppendText({AllHeaders}, strLineInsert$)
End If
End If
End Forall
Next
'Call cMemoObject.PostOpen(Source)
TheEnd:
Exit Sub
ErrorHandler:
Messagebox({Runtime Error in Form: 'Memo with Header'.PostOpen-Event} & strLinefeed$ & {Error } & Err() & { at line } & Erl() & {: } & Error())
Resume TheEnd
End Sub
Sub Postsave(Source As Notesuidocument)
'Call cMemoObject.PostSave()
End Sub
Sub Queryclose(Source As Notesuidocument, Continue As Variant)
'Call cMemoObject.QueryClose(Continue)
End Sub
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
'Continue = cMemoObject.QueryModeChange(Source)
End Sub
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
'Set cMemoObject = New UIMemoDocument
'Call cMemoObject.Init(Source,Isnewdoc)
End Sub
Usage / Example