Help

Table Of Contents
Creating scripts to automate tasks
F
ILEMAKER PRO HELP 435
' Sample code for accessing FileMaker Pro
' in Visual Basic.
'
' "FileMaker Pro 7.0 Type Library" must be checked
' and available in Visual Basic's Project/References.
'----------------------------------------------
'----------------------------------------------
' Declaring Objects and Launching FileMaker
'----------------------------------------------
' Declare object variables
Dim FMApp As FMPro70Lib.Application
Dim FMDocs As FMPro70Lib.Documents
Dim FMActiveDoc As FMPro70Lib.Document
' Launch FileMaker
Set FMApp = CreateObject("FMPRO.Application")
' Set the documents object
Set FMDocs = FMApp.Documents
' Make FileMaker visible (when launching from automation,
' FileMaker remains hidden by default.)
FMApp.Visible = True
'----------------------------------------------
' Querying open documents
'----------------------------------------------
'Check the open document count
If FMDocs.Count = 0 Then
Debug.Print "No open documents"
Else
Debug.Print "Open document count is:"; FMDocs.Count
End If
'--------------------------------------------------
' Opening a FileMaker database and running a script
'--------------------------------------------------