LOTUSSCRIPT/COM/OLE CLASSES


Examples: Accessing the current document
1. This example executes when the user enters a field in Edit mode. The script displays information about the field and document.
2. This example puts the current document in Edit mode if it is not, and toggles the ruler.
3. This example gets the database document that corresponds to the current UI document, then gets the parent database (that is, the current database).
4. This example gets the selected text in the current document.
5. This script first displays the names of users who have modified the document, then
opens the document.

6. This example places a value in the Categories text item using a NotesDocument object. When the NotesDocument object is saved, the workspace object is updated in real time. This code won't work for a rich text item.
7. This example composes a new document based on the "Person" form, and displays a dialog box based on the "Person Dialog Box" form to get information from the user. The "Person Dialog Box" form contains a layout region for which the fields have names that correspond to some of the fields in the "Person" form. When the user clicks OK in the dialog box, the data in the dialog box transfers to the fields of the same name in the new document.
8. This example opens the current document in a view in Edit mode and displays a dialog box based on the "Person Dialog Box" form to get information from the user. The "Person Dialog Box" form contains a layout region for which the fields have names that correspond to some of the fields in the current document. When the user clicks OK in the dialog box, the data in the dialog box transfers to the fields of the same name in the document.
9. This example is the same as the last but uses all the arguments to the DialogBox method. Argument 4 (True) displays only an OK button, argument 5 (True) refuses to add new fields to the underlying form, argument 6 (False) allows edits to be passed to the underlying form, argument 7 (False) allows the dialog box to be edited, and the last argument specifies a title for the dialog box.
10. This example finds a specified string in the current UI document.
11. This example imports a text document into the body of the current UI document.
12. This example puts the current document in Edit mode and checks it for spelling errors. The document must be in Edit mode before the SpellCheck method is called.
13. This example brings up the Find Free Time box and searches for available meeting times for the names listed in the SendTo field. The search is restricted to the range defined in the StartDateTime and EndDateTime fields.
See Also