|
Notes versie 7 zal (eindelijk) standaard een Disclaimer kunnen toevoegen aan de e-mail.
Voor R6 heb ik voor een klant een stukje code geschreven om aan de werkstation kant een disclaimer toe te voegen. In de standaard script library van het post sjabloon heb ik dit sub toegevoegd:
Sub AddDisclaimer() Dim MsgBody As Variant Dim isEmail As Integer Dim checkFields() As String Dim Disclaimer As String Dim BlankLine As String Redim checkFields( 0 To 2) As String checkFields(0) = "EnterSendTo" checkFields(1) = "EnterCopyTo" checkFields(2) = "EnterBlindCopyTo" isEmail = False
Forall fieldname In checkFields If Me.m_noteMemo.HasItem(fieldname) Then Forall address In Me.m_noteMemo.GetFirstItem(fieldname).Values If address Like "*@*.*" Then isEmail = True Exit Forall End If End Forall End If End Forall
If isEmail = True Then Redim checkFields( 0 To 2) As String checkFields(0) = "This e-mail may contain confidential and/or privileged information." checkFields(1) = "If you are not the intended receipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail." checkFields(2) = "Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden."
MsgBody = Me.m_noteUIMemo.FieldGetText( "Body" ) Forall fieldname In checkFields Disclaimer$ = Disclaimer$ & "*" & fieldname End Forall Disclaimer$ = Disclaimer$ & "*" If Not MsgBody Like Disclaimer$ Then isEmail = False End If
BlankLine$ = Chr(10)
If isEmail = False Then Call Me.m_noteUIMemo.GotoField("Body") Call Me.m_noteUIMemo.GotoBottom Call Me.m_noteUIMemo.FieldAppendText("Body", BlankLine$) Call Me.m_noteUIMemo.FieldAppendText("Body", Ustring$(160, "-")) Call Me.m_noteUIMemo.FieldAppendText("Body", BlankLine$) Call Me.m_noteUIMemo.FieldAppendText("Body", checkFields(0) & " ") Call Me.m_noteUIMemo.FieldAppendText("Body", checkFields(1) & " ") Call Me.m_noteUIMemo.FieldAppendText("Body", BlankLine$) Call Me.m_noteUIMemo.FieldAppendText("Body", checkFields(2) & " ") Call Me.m_noteUIMemo.FieldAppendText("Body", BlankLine$) Call Me.m_noteUIMemo.FieldAppendText("Body", Ustring$(160, "-")) Call Me.m_noteUIMemo.GotoField("Body") End If End If End Sub
Voor elke "Send" methode in de script library wordt deze functie aangeroepen.
|