Aus der KBASE:
Some Properties within the NotesName Class (Initials, Given, Surname) Do Not Return Values
Problem:
Within the NotesName class, you are attempting to use the Initials, Given and Surname properties to parse a name from a string. The Properties, however, return a null value.
Solution:
This issue was reported to Lotus Quality Engineering, but it was determined that Notes is functioning as designed.
The properties ADMD, Given, Initials, PRMD, Generation and Surname are not part of a standard Notes ID. These parameters were introduced in Notes 4.x to take advantage of addressing used for external mail and gateway mail products. Notes IDs and Notes names do not use these additional components; therefore, these properties of the NotesName class return a null value when applied to a standard Notes ID and name.
Workaround:
As a workaround, you can use the Common property of the NotesName class to determine the first name, middle initial (or middle name) and last name. To do this, you must make use of the LotusScript string functions: Instr, Left, Right, Mid. The Instr function finds instances in which a search string is contained within a source string. The Left, Right and Mid functions return a number of characters from a source string. For more information on these functions, refer to the Notes on-line Help or the LotusScript Language Reference manual.
Example:
This example is provided only for reference and will not stand on its own in all cases. For example, this script does not take into consideration last names that contain a space within them.
Sub Initialize
Dim s As New notessession
Dim findname As New notesname(s.username)
cname=findname.common
space1=Instr(1, cname," ")
space2=Instr(space1+1,cname," ")
'If space2 = 0 then no middle initial or middle name
first = Left(cname, space1-1)
If space2=0 Then
last=Right(cname, Len(cname)-space1)
Else
last=Right(cname, Len(cname)-space2)
middle=Mid(cname,space1+1,space2-space1-1)
End If
End Sub
Andreas