Thursday, 10 March 2011

GetFormattedName function

A simple function I came across going through some old code.

This code accepts a string and turns it into a names field, from which you can send a parameter to get the different types of name, such as Common, Canonical and Abbreviated.
Function GetFormattedName(strName As String, param AsStringAs String
        Dim n As New notesname(strName )
        Select Case param
        Case "CN"
                GetFormattedName= n.common
        Case "Canonicalize"
                GetFormattedName= n.canonical
        Case "Abbreviate"
                GetFormattedName= n.abbreviated
        End Select
End Function

No comments:

Post a Comment