Domino Code Fragment

Code Name*
NotesUI classes
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.219.189.247
Description*
You can use the NotesUI classes to create a document on the fly .
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Note This example assumes a form named Example and a Field named Subject
Files/Graphics attachments (if applicable): Code:
You can use the NotesUI classes to create a document on the fly, and fill in whatever fields need default data. After you initiate the document you can force save the document or let the user continue in the document in the normal manner.

Click here to view the example.

Dim workspace As New NotesUIWorkspace 'Declare workspace to the current open Notes workspace
Dim uidoc As NotesUIDocument
'Declare uidoc as a Notes document interface type
Set uidoc = workspace.ComposeDocument("" ,"" , "Example")

'Set uidoc to ComposeDocument method
Call uidoc.FieldSetText("Subject" , "A Document Created by NotesUI Classes")

'Call FieldSetText to set the field Subject from script
Call uidoc.save
'Save the document
Messagebox "This new document has been created, the subject was entered, and the document was saved. Click on OK, then press escape to return."

'Display a message to tell the user how to continue