Recent Contacts Tuning

With each version of Notes, there are more options to customize the recent contacts behaviour.
But these parameters are still interesting, because there is no UI representation:

DPABRemoveRule=domainA,domainB,textC
DPABRemoveRuleSetting=1

Using these parameters, you can exclude all recipients from the recent contacts matching one of the strings (example: user@domainA.com will be removed).

Since version 8.5.2, these parameters will also delete already existing documents from the recent contacts view matching one of the specified strings.
In prior versions, they prevent only new addresses to be added to recent contacts.

But it is not predictable when these paramters take effect. In my tests, we had anything from immediatelly up to several days.

If you want to delete some recent contacts, for example all users from your own domain (or even all documents), you can use this example code.
Just replace “domainA” with the search string you want to remove. This example supports only one searchstring, but it is quite easy to customize it for your needs.

Sub Initialize
Dim session As New NotesSession
Dim SearchStr As String

SearchStr = “domainA”

‘set notes.ini parameters
SearchStr = LCase(SearchStr)
Call session.Setenvironmentvar(“DPABRemoveRule”, SearchStr, True)
Call session.Setenvironmentvar(“DPABRemoveRuleSetting”, “1”, True)
Call session.Setenvironmentvar(“DPAB_PROMOTE_INC”, “10”, True)
Call session.Setenvironmentvar(“NEXTDPABSYNC”, “”, True)
Call session.Setenvironmentvar(“LAST_RECENT_CONTACT_CHECK”, “”, True)
Call session.Setenvironmentvar(“NeedDPABcache”, “”, True)

‘remove recent contact documents
Dim nab As NotesDatabase
Set nab = session.getdatabase(“”,”names.nsf”)
Dim rview As NotesView
Set rview = nab.Getview(“($RCLookup)”)
Dim doc As NotesDocument
Dim doc2 As NotesDocument
Set doc = rview.Getfirstdocument()
While Not doc Is Nothing
Set doc2 = rview.Getnextdocument(doc)
Dim address As String
address = LCase(doc.Getitemvalue(“$DPABDIPNAME”)(0))

If InStr(address, SearchStr) > 0 Then
Call doc.Removepermanently(True)
Print “deleted recent contact: ” & address
End If

Set doc = doc2
Wend

MessageBox “Recent contacts successfully removed”
End Sub

Advertisements
This entry was posted in IBM Notes/Domino and tagged , , , . Bookmark the permalink.

One Response to Recent Contacts Tuning

  1. Pingback: How to re-create recent contacts after a corruption | StephanKopp.net

Comments are closed.