Customize Mail Rules set-up to use with with non-mail database

Lotus Domino
I would like to be able to use a similar tool as Mail Rules in a Notes App to screen/filter out various words when anonymous users submit a form or bulletin. With modifications to a duplicate mail rule functions, (ie changing condition keyword like 'Subject' to 'Topic' etc., to filter certain words on fields used in other Notes application), I take it that this will not work in non-mail notes applications because this is triggered by the mail router. Right? Has anyone been successful in doing this or is there a better way. Would like certain users to maintain rules for the db. Mostly Notes clients.

Answer Wiki

Thanks. We'll let you know when a new response is added.

I think this what you mean, never played with the router, developer see.

Sub Censor(ndDiscussion As NotesDocument)
Not for the faint hearted, this sub replaces swear words with asterisks (*) in the
Body and Subject fields of the discussion forum docments.
Partial word stemming with find and replace to next space Chr(32).

Dim intExpletive As Integer, i As Integer
Dim strFieldContents As String, strAstericks As String

Dim aryExpletives(6) As String
‘To update banned word list, simply declare
‘words changed to protect the innocent
another array element
aryExpletives(1) = “Word1”
aryExpletives(2) = “Word2”
aryExpletives(3) = “Word3”
aryExpletives(4) = “Word4”
aryExpletives(5) = “Word5”
aryExpletives(6) = “Word6”

Forall e In ndDiscussion.Items
If (e.Name = “Subject” Or e.Name = “Body”) Then
Select Case e.Type
Case TEXT: ‘eg Subject
strFieldContents = Trim$(e.Values(0))
Case RICHTEXT: ‘ eg Body
strFieldContents = Trim$(e.Values)
End Select

For i = 1 To Ubound(aryExpletives)
intExpletive = Instr(strFieldContents, aryExpletives(i))
While (intExpletive > 0)
strAstericks = Asterick(Mid$(strFieldContents, intExpletive))
Mid$(strFieldContents, intExpletive, Len(strAstericks)) = strAstericks
intExpletive = Instr(strFieldContents, aryExpletives(i))
Next i

e.Values = Trim$(strFieldContents)
End If
End Forall

End Sub

Function Asterick(strExpletive As String) As String
Purpose: Calculate the number of * required to blot out an expeltive

Dim intSpace As Integer

intSpace = Instr(strExpletive, ” “) -1

‘If the expletive is the only word in the string
‘use string length as the number of * required
If intSpace < 1 Then intSpace = Len(strExpletive)

Asterick = String$(intSpace, Asc(“*”))
End Function

Cheers Paul

Discuss This Question:  

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: