ich habe einen agenten genommen, und hab ein wenig am anfang angepasst. (beim Kommentar zum Postopen)
hier mal der quelltext.
Dim session As New notessession
Dim Eintrag As String
Eintrag = session.getenvironmentstring("pbtraxx")
Dim Heute As String
Heute = Today()
If Heute = Eintrag Then
Exit Sub
End If
Set db = Session.currentdatabase '...works in Database PostOpen event, modify for other contexts
count=0
privateviewtext=""
Dim masterView As NotesView
tot = Ubound(db.views) + 1
Forall v In db.views
count=count+1
Print "Suche veraltete, private Ansichten " & cstr(count) & " von " & cstr(tot) & "..."
If isPrivateView(v) Then
Set masterView = getMasterView(v) '...get the shared view on which this personal view is based
If Not(masterView Is Nothing) Then
If v.Created < masterView.LastModified Then '...if the shared view design was updated after the private view was
'...then remove the private view
privateviewtext=privateviewtext & Chr(10) & v.name
v.remove
End If
End If
End If
End Forall
If privateviewtext="" Then
Print "Keine veralteten Ansichten gefunden."
Else
Print ""
Messagebox "folgende private ""Meine"" Ansichten mußten entfernt werden:" & privateviewtext & Chr(10) & "Schließen Sie die Datenbank und gehen wieder hinein."
End If
Call session.setenvironmentvar("pbtraxx",Heute)
End Sub
Function isPrivateView(v As NotesView) As Integer
isPrivateView = False
Set vdoc = v.parent.GetDocumentByUnid( v.UniversalID )
If Not (vdoc Is Nothing) Then
If vdoc.HasItem("$Flags") Then
If Instr(vdoc.GetItemValue("$Flags")(0), "V") Then
isPrivateView = True
Exit Function
End If
End If
End If
End Function
Function getMasterView(pView As NotesView) As NotesView
Set db = pView.parent
viewList = db.views
Dim view As NotesView
Forall v In viewList
If v.Name = pView.Name Then
Set view = v
If Not(isPrivateView(view)) Then
Set getmasterView = v '...get the shared view on which this personal view is based
Exit Function
End If
End If
End Forall
Set getMasterView = Nothing
Print "Die ursprüngliche Vorlage der privaten Ansicht '" & pView.name & "' konnte nicht gefunden werden."
End Function