Help

Table Of Contents
Creating scripts to automate tasks
F
ILEMAKER PRO HELP 436
' Note: A FileMaker file "c:\testing.fmp12" must be available
' with a script called "First Script" in order for the following
' to work.
Dim myOpenFile As Object ' note: can also be declared As
FMPro70Lib.Document
Set myOpenFile = FMDocs.Open("c:\testing.fmp12", "","")
myOpenFile.DoFMScript ("First Script")
'--------------------------------------------------
' Querying the active document
'--------------------------------------------------
Set FMActiveDoc = FMDocs.Active
' Display the active document's name
Debug.Print "The active file is "; FMActiveDoc.FullName
'--------------------------------------------------
' Enumerating and closing documents
'--------------------------------------------------
Dim TempToc As Object
If FMDocs.Count > 0 Then
For Each TempDoc In FMDocs
Debug.Print "About to close document: "; TempDoc.FullName
TempDoc.Close
Set TempDoc = Nothing
Next
End If
'----------------------------------------------
' Clean up and Quit
'----------------------------------------------
Set FMDocs = Nothing
Set FMActiveDoc = Nothing
Set myOpenFile = Nothing
' Quit FileMaker and release the variables