
681
ADOBE FRAMEMAKER SCRIPTING GUIDE
Function Summary
Last updated 9/26/2011
Open
Description
Opens a document or book. It can also create a new document.
Open()
allows you to specify a property list telling FrameMaker how to open or create the file and how to deal with
error and warning conditions.
For example, you can specify whether to abort or to continue opening a document if it contains fonts that are not
available. If the file is already open and invisible, it will make the file visible.
To get a property list to specify for the
openParams
parameter, use
GetOpenDefaultParams()
or create the list from
scratch.
To create a new document with
Open()
, set the
Constants.FS_NewDoc(29)
property in the
openParams
property list
to
True
.
Note:
When creating a new document (
Constants.FS_NewDoc (29)
is
True
) and you display the New dialog box
(Constants.
FS_ShowBrowser (1)
is
True
) and if the user clicks etiher Portrait, Custom, or Landscape in the New dialog
box,
Open()
does not create a document. Intead, it returns 0 and sets FA_errno to either
Constants.FE_WantsPortrait (-48)
,
Constants.FE_WantsCustom (-46)
, or
Constants.FE_WantsLandscape
(-47)
, respectively. It is up to your client to create a portrait, custom, or landscape document.
Note:
For more information on creating custom documents, see “
CustomDoc
” on page
652.
The method returns the document or book if it opens it successfully, or 0 if an error occurs.
The property list to which
openReturnParams
is set has the properties shown in the following table:
Both the
Constants.FS_OpenNativeError(2)
property and the
FA_errno
global variable indicate the result of a call
to
Open()
. The following table lists the possible status flags and the
FA_errno
and
Constants.FS_OpenNativeError(2)
values associated with them.
Property
Meaning and possible values
Constants.FS_OpenedFileName (1)
A string that specifies the opened file’s pathname. If you scripted
Constants.FS_ShowBrowser (1)
, or the file was filtered, or you did not specify
the pathname, this pathname can be different from the one you specified in the
Open script.
Constants.FS_OpenNativeError (2)
The error condition; normally the same value as
FA_errno
. If the file is opened
successfully, it is set to
FE_Success
.
Constants.FS_OpenStatus (3)
A bit field indicating what happened when the file was opened.