I’ve got a LotusScript action in a view that creates a new UIDoc, but when the action completes it give focus back to the view. Is there a way to automatically give focus to the newly created UIDoc in the same action script?
I needed to use LotusScript because I need to populate some fields, but cannot use “Formulas inherit values from selected document” because it will pull in some fields values that I don’t want.
TIA
Subject: RE: Get focus of NotesUIDocument
Perhaps you could show your code?
Subject: RE: Get focus of NotesUIDocument
Good idea Andre. 
Here it is:
Sub Click(Source As Button)
On Error Goto errorhandler
Dim ws As New NotesUIWorkspace
Dim uidoc1 As NotesUIDocument
Dim uidoc2 As NotesUIDocument
Dim company$
Dim ticker$
Set uidoc1 = ws.EditDocument( False )
company = uidoc1.FieldGetText("compname")
ticker = uidoc1.FieldGetText("ticker")
uidoc1.Close
Set uidoc2 = ws.ComposeDocument("","","Contact")
Call uidoc2.FieldSetText("compname",company)
Call uidoc2.FieldSetText("ticker",ticker)
Exit Sub
errorhandler:
Resume blankform
blankform:
Set uidoc2 = ws.ComposeDocument("","","Contact")
End Sub
TIA
Subject: RE: Get focus of NotesUIDocument
have you tried putting the focus on the form:
blankform:
Set uidoc2 = ws.ComposeDocument(“”,“”,“Contact”)
call uidoc2.gotofield(“Anyfield”)
End Sub TIA