ActiveX Automation objects, methods, and properties (Windows)
FileMaker Pro supports three Automation Objects: Application, Documents, and Document. The following are methods and properties available for the objects.
Application
Access to the FileMaker Pro application.
Properties
Note  All properties are read-only except "Visible."
Application: Returns a pointer to this object, which is the root object of the object hierarchy.
Parent: Returns a pointer to this object.
FullName: Returns the name of the application, including the path.
Name( ): Returns the name of the application - "FileMaker Pro."
Caption: Returns the window title for the frame window. The FileMaker Pro caption is always set to describe the currently active document and cannot be set differently by clients.
DefaultFilePath: Returns the default path specification used for opening files.
Documents: Returns a pointer to the Documents collection object so that individual Document objects may be opened, accessed, and run through scripting.
Version: Returns the version of FileMaker Pro.
Visible: Returns TRUE if the application is visible. Set to TRUE to show the application, FALSE to hide the application.
ScriptStatus( ): Returns 0 if no script is running, 1 if a script is paused, 2 if a script is running, or 3 if a script is queued (selected to run but not yet started).
Methods
Quit( ): Closes the application. Note that if clients are still attached, the application is hidden until all clients release the FileMaker Pro automation server. To prevent unexpected behavior, always follow a Quit statement with an object release statement. For example:
FMproApp.Quit
Set FMProApp = Nothing
Documents
This is the collection of open documents, or FileMaker Pro files.
Properties
Note All properties are read-only.
Application: Returns a pointer to the Application object.
Parent: Returns a pointer to the Application object.
Count: Returns the number of Documents (long integer) in the Document collection.
_NewEnum: Returns an enumerator object to traverse all the Document objects in the Document collection. This is not an explicit property of the object, but accessible implicitly when you use the document in a For loop.
Active: Returns the active document.
Item(variant): Returns a specific Document object from the collection. This method is the default member of the Documents Collection. It takes a variant parameter that can be specified by:
 •
 •
 •
Methods
Open(filename As String, accountName As String, password As String): Opens a specific FileMaker Pro file, creates a Document object, and returns a pointer to the Document object.
Close( ): Closes all documents in the collection and removes them from this collection. The Document Close statement produces a hard close of the document. If other users are connected to the FileMaker Pro database when the application receives a Document Close statement, they will be disconnected immediately, and without warning. Be sure to allow any connected users the opportunity to exit FileMaker Pro before sending this command.
Document
A Document is a FileMaker Pro database file.
Properties
Note  All properties are read-only.
Application: Returns a pointer to the Application object.
Parent: Returns a pointer to the Document Collection object, the parent of the Document object.
FullName: Returns the file specification of the document, including the path. If the Document FullName command is sent to a remote file running on a host, only the file’s name, and not its path, will be returned.
Path: Returns the path specification of the document. This does not include the filename or the extension.
Saved: Returns the state of the document (whether the document has been saved). FileMaker Pro always returns TRUE.
Active: If the Document object’s window is active, then TRUE is returned, otherwise, FALSE.
Methods
Activate( ): Makes the window associated with this Document object the active window.
Save( ): Flushes the database cache.
Close( ): Closes the document and removes it from the Documents collection.
DoFMScript(WhichScript As String): Executes a FileMaker Pro script on this Document object. The script is specified by name, and must already exist in the Document (for example, in the FileMaker Pro file).
Related topics 
Using FileMaker Pro ActiveX Automation (Windows)
ActiveX Automation example (Windows)