Subject: How to prevent duplicating disclaimer on fwds
I’m testing with the following code borrowed from this forum:
Sub Querysend(Source As Notesuidocument, Continue As Variant)
REM Start - added following lines for DISCLAIMER
Call Source.Refresh
Dim session As New NotesSession
Dim InternetMail, LocalMail, Duplicate, SendTo, CopyTo, BdyTex As Variant
InternetMail=False
LocalMail=False
Duplicate=False
SendTo=Source.FieldGetText("SendTo")
If Instr(SendTo,".") >0 And Instr(SendTo,"@") Then InternetMail=True
If Instr(SendTo,"/") >0 And Instr(SendTo,"MOC") Then LocalMail=True
CopyTo=Source.FieldGetText("CopyTo")
If Instr(CopyTo,".") >0 And Instr(CopyTo,"@") Then InternetMail=True
If Instr(CopyTo,"/") >0 And Instr(CopyTo,"MOC") Then LocalMail=True
BdyText=Source.FieldGetText("Body")
If Instr(BdyText,"This email") >0 Then Duplicate=True
If Not InternetMail And Not Duplicate Then
BdyText = Source.FieldGetText( "Body" )
If Instr(BdyText,"This email is intended") = 0 And Instr(BdyText,"However we accept no") =0 Then
Call Source.FieldAppendText ("Body",Chr(10))
Call Source.FieldAppendText ("Body","-- ")
Call Source.FieldAppendText ("Body",Chr(10))
Call Source.FieldAppendText ("Body","This email is intended only for the addressee named above and may contain ")
Call Source.FieldAppendText("Body","confidential or privileged information. If you are not the named addressee or ")
Call Source.FieldAppendText("Body","the person responsible for delivering the message to the named addressee, ")
Call Source.FieldAppendText("Body","please be kind enough to telephone us immediately. The contents should not ")
Call Source.FieldAppendText("Body","be disclosed to anyone nor copies taken. If you contact us by email, we may ")
Call Source.FieldAppendText("Body","store your name and address to facilitate communication. We take reasonable ")
Call Source.FieldAppendText("Body","precautions to ensure that our emails are virus free. However we accept no ")
Call Source.FieldAppendText("Body","responsibility for any virus transmitted by us and recommend that you subject ")
Call Source.FieldAppendText("Body","any incoming email to your own virus checking procedures.")
End If
End If
REM End - added following lines for DISCLAIMER
End Sub
The test for existing disclaimer text in the body field is not working when I forward or reply with history to a message already disclaimed. The same code is on the Memo form and the Reply With History form. Help!
Thanks in advance,
John Rowland