CurrentDocument (NotesUIWorkspace - LotusScript®)

Returns a NotesUIDocument object representing the document in the window that currently has focus.

Defined in

NotesUIWorkspace

Data type

NotesUIDocument

Syntax

Set notesUIDocument = notesUIWorkspace .CurrentDocument

Return value

notesUIDocument

Represents the current document. If there is no document currently open on the workspace, this method returns Nothing.

Usage

This method cannot be used to access the document that's currently highlighted in a view or folder.

Do not use this method to get the current document in form events such as Postopen. Instead, use the Source argument supplied to these events.

The "current document" is the one that has focus. When opening documents in a composite application, frameset, or as an embedded editor, the document being opened might not have focus at the time its Postopen event code runs.

As a coding best practice, in form event code it is preferable to use the Source parameter supplied in the event subroutine call.

Example