Lotus Notes FAQ Visit Our Sponsor!

Why doesn't NotesUIDocument.GetFieldText return the alias for a keyword selection?

The NotesUIDocument class is designed to work with the interface elements (what is being displayed) of a document. Because of this, the value you retrieve from a field is what is being displayed to a user.
If you are designing a new form, a workaround you can use is to make the aliases numerical such as:
  Draft | 1
  Submitted | 2
  Comment | 3

Then, you can handle each case using this code (if the keyword field is named "Status"):
  Dim ws As New NotesUIWorkspace
  Dim doc As NotesDocument
  Dim uidoc As NotesUIDocument
  Dim desiredresult As Variant
  Set uidoc = ws.CurrentDocument
  Set doc = uidoc.Document
  desiredresult = doc.GetItemValue("Status")
  Select Case desiredresult(0)
  Case "1"
       ...
  Case "2"
       ...
  Case Else
       ...
  End Select

Applies to Notes Versions: 4 4.5 4.6 5
Last Modified: January 6, 1998