Function ConvertName(origstr As STring, formatstr As String) As String ' converts NotesName formats ' origstr - string being converted ' formatstr - format desired, e.g. cn=common name, abbrev=abbreviated, canonical=canonical Dim tmpName As NotesName ' name object for conversion Set tmpName = New NotesName(origstr) If (tmpName is Nothing) Then ' cancel out, return origstr ConvertName = origstr Exit Function End If Select Case formatstr Case "cn" ConvertName = tmpName.Common Case "abbrev" ConvertName = tmpName.Abbreviated Case "canonical" ConvertName = tmpName.Canonical Case Else ' bad format type passed, return origstr ConvertName = origstr End Select End Function Example for Domino Directory to Update the Manager field using LSConvertName: Sub Initialize Dim w As New NotesUIWorkspace Dim s As New NotesSession Dim db As NotesDatabase ' current db Dim pCol As NotesDocumentCollection ' documents selected (all in view in this case) Dim pDoc As NotesDocument ' current person doc being processed Dim picklist As Variant ' choice returned Dim oldnm As String ' previous mgr name Dim newnm As String ' new mgr name Dim docnm As String ' current document value Dim pcounter As Double ' counter of pDocs processed On Error GoTo ErrorHandler ' setup Set db = s.CurrentDatabase Set pCol = db.Unprocesseddocuments pcounter = 0 ' check for no docs If (pCol.Count = 0) Then ' cancel MsgBox "No documents in view to process.", ,"Done" Exit Sub End If ' get the old name picklist = w.PickListStrings( PICKLIST_CUSTOM, False, db.Server, db.Filepath, "(lupMYViewNames)", _ "Previous Manager", _ "Please the previous manager name.", 1) If (IsEmpty(picklist)) Then ' cancel MsgBox "No name picked.", ,"Cancelled" Exit Sub End If oldnm = CStr(picklist(0)) If (oldnm="") Then ' cancel MsgBox "No name picked.", ,"Cancelled" Exit Sub End If ' get the new name picklist = w.PickListStrings( PICKLIST_CUSTOM, False, db.Server, db.Filepath, "(lupMYViewNames)", _ "New Manager", _ "Please the NEW manager name.", 1) If (IsEmpty(picklist)) Then ' cancel MsgBox "No name picked.", ,"Cancelled" Exit Sub End If newnm = CStr(picklist(0)) If (newnm="") Then ' cancel MsgBox "No name picked.", ,"Cancelled" Exit Sub End If ' do sanity check on names If (oldnm = newnm) Then ' cancel MsgBox "Old and new names are the same.", ,"Cancelled" Exit Sub End If ' make sure all names are canonical oldnm = LSConvertName(oldnm, "canonical") newnm = LSConvertName(newnm, "canonical") ' ready to do, let's loop and process Set pDoc = pCol.GetFirstDocument() While Not (pDoc Is Nothing) docnm = CStr(pDoc.Manager(0)) If Not (docnm = "") Then docnm = LSConvertName(docnm, "canonical") End If If (oldnm = docnm) Then ' have match, replace Call pDoc.Replaceitemvalue("Manager", newnm) Call pDoc.Save(True, False) pcounter = pcounter + 1 End If ' loop Set pDoc = pCol.GetNextDocument(pDoc) Wend ' done MsgBox "Done processing. Updated Manager field in " & CStr(pcounter) & " documents.", ,"Done" Exit Sub ErrorHandler: Print "(MyAgentName - Initialize) Error " & CStr(Err) & " " & Error$ & ", on line: " & CStr(Erl) & "." End Sub