Good day,
I want to extract the current user’s Given Name, Initials and Surname. And then only want to use the first character of each.
For example, if the username is “Lieschen X Summers”, then end result should be “LXS”.
I have the following script:
Dim nam As NotesName
Set nam = s.CreateName(s.CommonUserName)
sourcen$ = Left$(nam.Given,1) & Left$(nam.Initials,1) & Left$(nam.Surname,1)
But it returns blank?
Any ideas.
Thank you in advance.
Subject: nam.Given&nam.Initials&nam.Surname not working
Subject: RE: nam.Given&nam.Initials&nam.Surname not working
o, ok.Thanks
Subject: RE: nam.Given&nam.Initials&nam.Surname not working
Lieschen, how about something like this perhaps
dim Initials as string
Nam = split(s.CommonUserName," ")
Forall Nams in Nam
Initials = Initials & left$(trim$(cstr(Nams)),1)
End Forall
Subject: nam.Given&nam.Initials&nam.Surname not working
The problem is that normal Notes names do not have a .Given, a .Surname or .Initials component. See the Designer Help entry for @Name for more information. You’d need to look the values up in the Perso document (if one exists for the name).