ComposeDocument (NotesUIWorkspace - LotusScript®)

Using a database and form that you specify, creates a new document and displays it on the workspace.

Defined in

NotesUIWorkspace

Syntax

Set notesUIDocument = notesUIWorkspace .ComposeDocument( [ server$ [, file$ [, form$ [, windowWidth# [, windowHeight# [, returnNotesUIDocument]]]]]] )

Parameters

server$

String. Optional. The name of the server where the database resides. If this parameter is omitted or is an empty string (""), the database is opened on the local computer. If both server$ and file$ are omitted or empty strings, the current database is used.

file$

String. Optional. The file name of the database where you want to compose a document. If this parameter is omitted or is an empty string (""), a document is composed in the current database.

form$

String. Optional. The name of the form you want to use to compose the document. If this parameter is omitted or is an empty string (""), the Create Other dialog box is displayed and the user can select a form name.

windowWidth#

Double. Optional. The width in inches of the document window. If this parameter is omitted, the window is the width of the current window.

Note: This parameter is obsolete in Release 5.0 but is maintained for backward compatibility.

windowHeight#

Double. Optional. The height in inches of the document window. If this parameter is omitted, the window is the height of the current window.

Note: This parameter is obsolete in Release 5.0 but is maintained for backward compatibility.

returnNotesUIDocument

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

Note: This parameter is new with Release 6.

Return value

notesUIDocument

The document that was just created and opened.

Usage

If the ComposeDocument method is used in a view action, the form formula of the view overrides the form specified in the method. To avoid this problem, add the following line to the form formula:

@If(@IsNewDoc; @Return(Form); "");

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.

Example