WR OPEN DOCUMENT

4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next

version 6.5 (Modified)


WR OPEN DOCUMENT (area; document{; type})

ParameterTypeDescription
areaLongint4D Write area
documentStringPath of document to open
Path of the opened document
typeStringType of the document to open (4 characters)
Type of the open document (4 characters)

Description

The WR OPEN DOCUMENT command opens the document specified by document and places it in the 4D Write area referenced by area.

document is the name or the complete access path of the document file. On Windows, you must include the file extension in addition.

Examples:

on Windows, you must include the "\" character between directories:

"D:\directory1\directory2\file.4W7").

on MacOS, you must include the ":" character between folders:

"MacintoshHD:Folder:Document".

If document contains only the name of the file, WR OPEN DOCUMENT will look for the document in the folder of the database's structure file.

If document is an empty string, WR OPEN DOCUMENT displays the standard Open file dialog.

When the Open button of the Open file dialog is clicked the OK system variable is set to 1, and the document variable will be assigned the complete access path of the file the user selects.

In this case the type parameter returns the type selected by the user in the type drop-down list or the document type if no type was selected by the user.

If the user clicks the Cancel button, document returns an empty string and the OK system variable is set to 0.

The type optional parameter allows you to filter the document types displayed by default in the standard Open Document dialog box— except for HTML documents. For HTML documents, the type parameter is used for displaying either the HTML source code (if type "TEXT" is passed) or the HTML page (if type contains "HTML" or is omitted).

The file formats supported by this command are:

TypeFiles
4WR74D Write
4WR64D Write version 6.0
4WT7Template 4D Write
RTFRTF file
DOC6Word document
ASCWWindows text file
ASCMMac OS text file
ASCUUnicode text file
HTMLHTML text file

Example

The following example opens a file located in the database's directory.

   WR OPEN DOCUMENT(area;"HD:Folder:database folder:File")   'On Mac OS
   WR OPEN DOCUMENT(area;"D:\directory\Basedirectory\file.4W7")   'On Windows

See also

WR SAVE DOCUMENT.


4D - Documentation   Français   English   German   4D Write, Command Theme List   4D Write, Command Alphabetical List   4D Write, Constant Theme List   Back   Previous   Next