ActiveX Automation example (Windows)' 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.Dim FMApp As FMPro70Lib.Application
Dim FMDocs As FMPro70Lib.Documents
Dim FMActiveDoc As FMPro70Lib.Document' Make FileMaker visible (when launching from automation,
' FileMaker remains hidden by default.)If FMDocs.Count = 0 Then
Debug.Print "No open documents"
Else
Debug.Print "Open document count is:"; FMDocs.Count
End If' 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.DocumentSet myOpenFile = FMDocs.Open("c:\testing.fmp12", "","")
myOpenFile.DoFMScript ("First Script")Debug.Print "About to close document: "; TempDoc.FullName
TempDoc.Close
Set TempDoc = Nothing
Next
End IfFMApp.Quit
Set FMApp = Nothing