LOTUSSCRIPT/COM/OLE CLASSES


Accessing the current document in LotusScript classes
Example

You can access the back-end document that is currently open through the NotesUIWorkspace and NotesUIDocument classes. Using the NotesUIView class, you can access the back-end documents in the view with the Documents property.

The NotesUIDocument class has the following properties:

PropertyData typeDescription
AutoReloadBoolean(Read-write) True to automatically reload the current document any time there is a change.
CurrentFieldString(Read-only) The name of the current field if the document is in Edit mode.
DialogBoxCanceled Boolean(Read-only) Indicates if a user cancels a dialog.
DocumentNotesDocument(Read-only) A reference to the NotesDocument object associated with this document window, giving you access to the back-end properties and methods. If you modify and save an item using the NotesDocument object, the item is automatically updated in the workspace, except for rich text items.
EditModeBoolean(Read-write) True for Edit mode.
FieldHelpBoolean(Read-write) True to display field help.
HorzScrollBarBoolean(Read-write) True if the horizontal scroll bar is visible.
HiddenCharsBoolean(Read-write) True to display hidden characters.
InPreviewPaneBoolean(Read-only) True if the document is being accessed from the preview pane.
IsNewDocBoolean(Read-only) True if the document is not yet saved.
PreviewParentDocBoolean(Read-write) True if the lower pane containing the parent document is displayed.
PreviewDocLinkBoolean(Read-write) True if the lower pane containing the linked document is displayed.
RulerBoolean(Read-write) True if the ruler is visible.
WindowTitleString(Read-only) The name of the window title.
The NotesUIDocument class has the following methods:
MethodDescription
CategorizeCategorizes the current document.
ClearClears the selected text.
CloseCloses the current document.
CollapseAllSectionsCollapses all sections in the document.
CopyCopies the selected text to the Clipboard.
CreateObjectCreates an object in a rich text item.
CutCuts the selected text and places it on the Clipboard.
DeleteDocument Marks the current document for deletion and closes it. The NotesUIDocument object is no longer available once you call this method.
DeselectAllDeselects the entire contents of the current field.
ExpandAllSectionsExpands all sections in the document.
FieldAppendTextAppends the specified text to the specified or current field.
FieldClearClears the contents of the specified or current field.
FieldContainsReturns True if the specified or current field contains the specified case-sensitive text.
FieldGetTextGets the text of the specified or current field.
FieldSetTextSets the specified or current field to the specified text.
FindFreeTimeDialogBrings up the Find Free Time box.
FindFreeTimeDialogEx Brings up the Find Free Time box to allow searches for available meeting times.
FindString Finds the text in a given field.
ForwardCreates a new mail document and prompts for recipients.
GetObjectGets a specified object.
GetSchedulerObjectGets an embedded scheduler.
GetSelectedText Gets the selected text in a UI document.
GotoTopGoes to the first field or scrolls to the top of the document.
GotoBottomGoes to the last field or scrolls to the bottom of the document.
GotoField Given a field name, puts the cursor in the specified field in a document.
GotoNextFieldGoes to the next field or scrolls so that it is visible.
GotoPrevFieldGoes to the previous field or scrolls so that it is visible.
GotoTop Places the cursor in the first editable field or the first button in a document.
Import Imports a file to the document.
InsertTextInserts the specified text at the current cursor position.
NavBarSetTextSets the URL navigation bar text.
NavBarSpinnerStartStarts the URL navigation bar spinner.
NavBarSpinnerStopStops the URL navigation bar spinner.
PastePastes the Clipboard text to the current cursor position.
PrintPrints the current document.
RefreshRefreshes the document.
RefreshHideFormulasRecalculates the hide-when formulas for the current document; this is an expensive operation.
ReloadRefreshes the current document with any changes made to the stored document.
SaveSaves the current document.
SaveNewVersionSaves the current document as a new version.
SelectAllSelects the entire contents of the current field.
SendMails the current document and closes it.
SpellCheck Checks the spelling in a document.
The NotesUIView class has the following properties:
PropertyData typeDescription
CalendarDateTime Variant of type DATE(Read-only) The date and time of the current region in a calendar view.
CaretCategory Variant(Read-only) Returns the current category in the view for the current document.
Documents NotesDocumentCollection(Read-only) All the documents that the current NotesUIView event is working on.
View NotesView(Read-only) The back-end view that corresponds to the currently open view.

The NotesUIView class has the following methods:

MethodDescription
Print Implements the @Command([FilePrint]). Prints the currently open or selected document(s), or the current view.
SelectDocument Selects the specified document in a view.
For a list of events in NotesUIView, see "Event Descriptions" in the "Programming Overview" chapter.

Example
See Also