Hi Daniela,
ich verwende dazu folgenden Agenten:
Sub Initialize
Dim session As New notessession
Dim nab As New notesdatabase ("" , "")
Dim view As notesview
Dim pointer As notesdocument
Dim mail As New notesdatabase ("" , "")
Dim profile As notesdocument
Dim session1 As New notessession
Dim db1 As notesdatabase
Dim profile1 As notesdocument
Set db1 = session1.currentdatabase
Set profile1 = db1.getprofiledocument("profile")
server = profile1.AC_HS(0)
If nab.open ("SERVER1" , "names.nsf") Then
Set view = nab.getview("Personen")
Set pointer = view.getfirstdocument()
While Not pointer Is Nothing
On Error Goto NoAccess
Print "Mailfile pointer.mailfile(0): " + "" + pointer.mailfile(0) + ""
Set mail = New NotesDatabase(server , "" + pointer.mailfile(0) + "")
If mail.IsOpen Then
Set profile = mail.getprofiledocument("CalendarProfile")
If Not ( profile Is Nothing ) Then
Print "Original profile.owner(0): " + profile.owner(0)
Print "Would be pointer.fullname(0): " + pointer.fullname(0)
profile.owner = pointer.fullname(0)
Call profile.save(True,False)
End If
End If
LoopWhile:
Set pointer = view.getnextdocument(pointer)
Wend
End If
Goto end_sub
NoAccess:
Print "########### E R R O R --- NO ACCESS ##############"
Goto LoopWhile
end_sub:
End Sub
Den Server, auf dem die Mailfiles liegen ist in einem Profildokument hinterlegt, Du kannst Du aber den Server ja auch aus dem Personendokument ziehen.
Gruss JoFa
PS: Ist nicht sehr übersichtlich aber funktional und "gewachsen" ;-)