I'm trying to run the following on a normal text field in Notes, but it craps out. I'm wondering if maybe GetSelectedText won't work on plain text fields, though Help doesn't seem to indicate any such restrictions.
I want to get the text that the user selects in a field, and clear it. (Later on I'm going to replace it with the selected text that I've gone and done stuff to.)
Sub Click(Source As Button)
Dim wrksp As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As notesdocument
Dim seltext As String
Dim test As String
Dim BeginTag As String
Dim EndTag As String
Dim session As New NotesSession
Dim flag As Variant
Dim fieldName As String
fieldName = "Text"
Set uidoc = wrksp.CurrentDocument
Set doc=uidoc.document
On Error Goto nowtselected
seltext = uidoc.GetSelectedText(fieldname)
Msgbox seltext [Note: seltext comes back blank)
Call Session.SetEnvironmentVar( "EnvSelectedText", seltext )
Msgbox "got here1 fine"
Call uidoc.Clear
[Note: craps out completely upon attempting the above operation]