LOTUSSCRIPT/COM/OLE CLASSES
Sub Click(Source As Button) Dim session As New NotesSession Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument Call uidoc.InsertText( session.CommonUserName ) End Sub
This script, for a button, inserts the user's name into FieldOne whenever the button is clicked. You cannot insert into the "current" field with a button because the focus is on the button.
Sub Click(Source As Button) Dim session As New NotesSession Dim workspace As New NotesUIWorkspace Dim uidoc As NotesUIDocument Set uidoc = workspace.CurrentDocument Call uidoc.GotoField( "FieldOne" ) Call uidoc.InsertText( session.CommonUserName ) End Sub
See Also