I’ve been struggling trying to find a way to implement a disclaimer for all mail being sent by our Notes users. I used the code posted by someone else here, but it is not 100% and causes a lot of duplicate disclaimer when saving, forward, or replying with history.
So, I came up with my own version that uses the signature handling functionality of the CoreEmailClasses script library under the Declarations section (whether they have signatures enabled or not).
The only caveat is that the user still has the ability to delete/modify the disclaimer since it’s editable text in their email.
In the PostOpen function:
If IsFlagSet(MEMO_AUTOSIGNATURE) Then
Call InsertSignature(True)
Else
'Insert legal disclaimer even if the signature is not enabled
Call Me.m_noteUIMemo.GotoField("Body")
Call Me.m_noteUIMemo.InsertText(Chr(10) + Chr(10) + "Disclaimer Text")
End If
In the InsertSignature subroutine:
Case 1
If FromMailPreference Then Call Me.m_noteUIMemo.GotoField("Body")
Call Me.m_noteUIMemo.inserttext(Me.m_strSignature)
'Insert legal disclaimer
Call Me.m_noteUIMemo.InsertText(Chr(10) + Chr(10) + "Disclaimer Text")
If FromMailPreference Then Call Me.m_noteUIMemo.GotoField("Body")
Case 2
If FromMailPreference Then Call Me.m_noteUIMemo.GotoField("Body")
Me.m_vFILTER = Evaluate(|@RightBack("| & Me.m_strSignature & |";".")|)
If Trim(Me.m_vFILTER(0)) <> "" Then strFileExt = Trim(Ucase(Me.m_vFILTER(0)))
If Iselement(strFilterList(strFileExt)) = True Then
strFilterString = strFilterList(strFileExt)
End If
Else
strFilterString = ""
End If
Call Me.m_noteUIMemo.InsertText(Chr(10))
Call Me.m_noteUIMemo.Import(strFilterString, Me.m_strSignature)
'Insert legal disclaimer
Call Me.m_noteUIMemo.InsertText(Chr(10) + Chr(10) + "Disclaimer Text")
If FromMailPreference Then Call Me.m_noteUIMemo.GotoField("Body")
End Select