Subject: Agent that will find databases that have more than one $Inbox
Here is some code, you need to add a loop round the return nid’s, but the basic idea is here.
Sub Initialize
Dim targetdb As New NotesDatabase(“”, “”)
Dim tserver As String
Dim formname As String
Dim collection As NotesDocumentCollection
Dim dbDir As NotesDbDirectory
Dim dbFilePath As String
Dim dbFolder As String
Dim msg As String
Dim fn As Integer
Dim memo As NotesDocument
Dim search As String
Dim language As String
Dim nc As NotesNoteCollection
On Error Resume Next
fn = Freefile()
Open “logfile” For Output As fn
tserver = “your server”
Set dbDir = New NotesDbDirectory(tserver)
Set targetdb = dbDir.GetFirstDatabase(TEMPLATE_CANDIDATE)
Do While Not(targetdb Is Nothing)
If targetdb.Title <> “Database Stub” Then
dbFilePath = targetdb.FilePath
dbFolder = Ucase(Strleftback(dbFilePath, ""))
If Lcase(Left$(dbFolder, 4)) = “mail” Then
formname = getDefaultFormName(tserver, dbFilePath) Call targetdb.Open(tserver, dbFilePath)
Set nc = targetdb.CreateNoteCollection(False)
nc.SelectFolders = True
Call nc.BuildCollection
Set memo = targetdb.GetDocumentByID(nc.GetFirstNoteId)
If Not memo Is Nothing Then
If memo.Title = “($Inbox)” Then
count = count + 1
End If
Print #fn, targetdb.Title
End If
End If
Set targetdb = dbDir.GetNextDatabase
Loop
Close fn
End Sub