EditDocument (NotesUIWorkspace - LotusScript®)

Opens the current or a specified document in a mode that you specify.

Defined in



Set notesUIDocument = notesUIWorkspace .EditDocument( [editMode] , [notesDocument] , [notesDocumentReadOnly] , [documentAnchor$] , [returnNotesUIDocument] , [newInstance] )



Boolean. Optional. Specify True (default) to open the document in Edit mode. Specify False to open the document in Read mode or to put the document in the given Edit mode.


NotesDocument. Optional. Opens the specified document instead of the currently selected document.


Boolean. Optional. If True, sets notesDocument to read-only mode, which prevents the user from later switching to read-write mode. Defaults to False. This parameter does not open the document in Read mode; you must set editMode to False. This parameter has no effect if you do not specify notesDocument.


String. Optional. Opens the document to an anchor link within the document. This parameter specifies the text of the anchor link. The edit mode (parameter 1) must be False if this parameter is specified.


Boolean. Optional. If True (default), attempts to return the NotesUIDocument object; if False, does not attempt to return the object. See the usage note on lsERR_LSXU13_ANCESTOR_TARGET_FRAME.

Note: This parameter is new with Release 5.0.6.


Boolean. Optional. If True (default), opens a new instance of notesDocument (parameter 2) in the UI. If False, changes focus to an existing instance of notesDocument if one exists, or to a new instance if one does not exist. This parameter does not apply if notesDocument is not specified or the document has a target frame.

Note: This parameter is new with Release 6.

Return value


The document that's just been opened. Does not attempt to return this object if returnNotesUIDocument is False.


The current document may be either of the following:

  • The document that's currently open.
  • The document that's currently selected in a view or folder.

This method raises the error lsERR_LSXU13_ANCESTOR_TARGET_FRAME (4426) if it attempts to return a NotesUIDocument object for a target frame that is the ancestor of the frame containing the code. You can suppress returning the object by specifying returnNotesUIDocument as False. The document opens in the target frame but you do not have access to its NotesUIDocument object. Calling this method as a subroutine does not suppress returning the object; you must specify returnNotesUIDocument as False.