Kann es sein, dass die gleiche Datenbank mehrfach in CGdoc vorkommt?
Falls ja, kannst Du Dir bspw. den letzten Wert für die Repl ID merken:
Sub Click(Source As Button)
Dim s As New NotesSession
Dim directory As NotesDbDirectory
Dim db As New NotesDatabase("","")
Dim repID As String
Dim repID_alt As String
Dim server As String
Dim datei As String
Dim eval, alterString, neuerString As String
Dim CGdb As NotesDatabase
Dim CGview As NotesView
Dim CGdoc As NotesDocument
Set CGdb = s.CurrentDatabase
Set CGview = CGdb.GetView("0. Corporate Desktop(s) Categorized")
Set CGdoc = CGview.getfirstdocument
alterString = ":"
neuerString = ""
repID_alt = ""
While Not(CGdoc Is Nothing)
If CGdoc.form(0) = "f_database_icon" And CGdoc.k_db_type(0) = "spec" Then
server = CGdoc. t_db_server(0)
repID = CGdoc.t_db_replica_id(0)
eval = Replace(repID, ":", "")
repID = eval(0)
if repID_alt <> repID then
Call db.OpenByReplicaID(server , repID)
end if
Print db.Title
repID_alt = repID
End If
Set CGdoc = CGview.getnextdocument(CGdoc)
Wend
End Sub
Tipp:
Dim eval, alterString, neuerString As String
macht man nicht, sonderm
Dim eval as variant
dim alterString as string, neuerString As String
Andreas