How to reformat mail file owner name

Hello, I’d like to know how to massage the info I obtained from the Mail File Owner field so that its simple in “FirstName LastName” format instead of “CN=FirstName LastName,O=Org”. I used this formula to get aquire the Mail File Owner but I’m not sure how to massage the results. Anybody know? (It must be in Lotuscript … otherwise I would have used the good old fashion @Middle which doesn’t work in Lotuscript that I’m aware of).

Set cprofile = db.GetProfileDocument(“CalendarProfile”)

mailowner = cprofile.GetItemValue(“Owner”)(0)

Subject: NotesName

You’re looking for the NotesName class (and btw, even in Formula you should be using @Name to get out proper components instead of using unreliable string handling like @middle). NotesName creates a name object from which you can get all sorts of formats and nameparts. The part you seem to be looking for is Common Name so, you could use something like the following:

Set cprofile = db.GetProfileDocument(“CalendarProfile”)

set ownerName = new NotesName( cprofile.GetItemValue(“Owner”)(0))

mailowner = ownerName.Common

Subject: Thank you!

Knowledge is power. Thank you so much for this, worked like a champ!