Erst einmal recht herzlichen Dank an Alle!
Ich würde gerne die Lösung von Diri bevorzugen,
bekomme aber wieder bei der Evaluate-Zeile die Fehler-Meldung "Type Missmatch".
Dim session As New NotesSession
Dim books As Variant
Dim view As NotesView
Dim doc As NotesDocument
Dim done As Variant
Dim person As String
Dim person1 As Variant
books = session.AddressBooks
done = False
' person = Strrightback(session.commonusername," ") + " , " + Strleftback(session.commonusername," ")
' person = session.username
person1 = Evaluate(|@Name([Abbreviate];@UserName)|)
' Msgbox person1
' person = session.username
Forall b In books
' check every Domino Directory,
' unless we're already done
If ( b.IsPublicAddressBook ) And ( Not done ) Then
Call b.Open( "", "" )
' look up person's last name
' in People view of address book
Set view = b.GetView( "($VIMPeople)" )
Set doc = view.GetDocumentByKey( person )
' if person is found, display the phone number item
' from the Person document
If Not ( doc Is Nothing ) Then
Messagebox( "Phone for " + person _
+ " is " + doc.Stellvertreter( 0 ) )
done = True
doc.Stellvertreter="Hugo1"
Messagebox( "Phone for " + person _
+ " is " + doc.Stellvertreter( 0 ) )
If ( doc.Save( False, False ) = True ) Then
Messagebox "Document " & doc.UniversalID & " successfully saved"
Else
Messagebox "Document " & doc.UniversalID & " was not saved"
End If
Else
Msgbox "nicht gefunden"
End If
End If
End Forall
' if done is still False, the person wasn't found
If Not done Then
Messagebox _
( "Sorry, unable to locate person's name." )
End If
Wo liegt mein Denkfehler?
Gruß + Danke
Marshuhn