OpenDocument @Command (Formula Language)
Opens a document.
Syntax
@Command( [OpenDocument] ; writeOrReadOnly ; UNID ; width : height)
Parameters
writeOrReadOnly
Text ("1" or "0"). Optional. A value of "1" opens the document in Edit mode. A value of "0" (the default) opens the document in Read-only mode.
UNID
Text. Optional. The UNID (unique document ID) of the document you want to open. If you omit this parameter, Notes/Domino opens the currently selected document. You can find a document's unique id on the Document IDs tab of the Document properties box. The UNID begins after "OF" on the first line and continues after "ON" on the second line. Omit the colons.
width : height
Number list. Optional. The width and height, in inches, of the window for the document you open.If you omit this parameter or use zero for either value, you create the window at the default size (usually the size that the last user set).
Usage
A database must be open to a document view and the view must contain the document you want to open.
The width-height parameter does not apply in MDI mode when the window is maximized. When restored, the window returns to the size you specify. The measurement in inches matches the ruler bar in the editor, so you can use the ruler bar to guide you in sizing the window. When you specify the width and height, you center the window in the enclosing Notes/Domino window (for MDI mode) or in the operating desktop (for Mac and SDI mode).
You can use this command in Web applications, but it must be used in conjunction with @Command([FileOpenDatabase]) or @Command ([OpenView]). You can use the URL command to open a document by its UNID; see the "URL commands for opening documents by key" section of the Application Development with Domino® Designer guide.
Examples
- This formula opens the selected document in Read mode.
@Command([OpenDocument])
- This formula also opens the selected document in Read mode.
@Command([OpenDocument];"0")
- This formula opens the selected document in Edit mode and moves
the cursor to the Subject field.
@Command([OpenDocument];"1"); @Command([EditGotoField];"Subject")
- This formula opens a document by UNID.
@Command([OpenDocument];"";"F56ACC1F6F27155D8525686500603D43")
- This formula opens the document, "Savage Mountain," in the By
Title view of a Web application.
@Command([OpenView];"By Title";"Savage Mountain"); @Command([OpenDocument])
- This formula opens the document, "Savage Mountain," in Edit mode
when it is accessed by a browser.
@Command([OpenView];"By Title";"Savage Mountain"); @Command([OpenDocument]; "1")