Public Sub DeleteAlias()
Dim oConstit As CRecord
Dim lAlias As Long
Dim lLoop As Long

Set oConstit = New CRecord
oConstit.Init REApplication.SessionContext
oConstit.Load 200 'open specific system record id 200

lAlias = oConstit.Aliases.Count

For lLoop = lAlias To 1 Step -1
If oConstit.Aliases.Item(lLoop).Fields(ALIAS_fld_ALIAS_TYPE) = "Nickname" Then
       oConstit.Aliases.Remove oConstit.Aliases.Item(lLoop).Fields(ALIAS_fld_ID)
End If
Next lLoop

oConstit.Save
oConstit.CloseDown
Set oConstit = Nothing

End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.