HomeGuides :: Symphony ProfilerSoftware Development KitAutomating Symphony Profiler Workstation

6.1. Automating Symphony Profiler Workstation

Automation capabilities were added to Symphony Profiler Workstation in version 1.0.4.31

Right now, automation allows a caller to display the Symphony Create Reservation dialog, providing default values for the various aspects of the Worldox index card dialog.

Automation is exposed via standard Windows COM capabilities.  The type library for accessing the automation is titled 'Symphony Profiler Workstation Type Library' (if you wish to use early binding), or via CreateObject calls against the SymphonyProfiler4WD namespace.

This functionality is still fairly new, and we are very open to extending it and our documentation - if you are a developer and would like more information, please open a support ticket by emailing support@trumpetinc.com

Here is example code that demonstrates how to invoke the automation:

' This example uses late binding.  You can also use early binding by including
' a reference to "Symphony Profiler Workstation Type Library" in your project
Public Sub exerciseShowReservationDialog()
    ' first, set up a WDReservationInfo object with the default values you want the Save As dialog to display
    ' if you want to use the user's defaults, just create the info object and don't populate it

    Dim info As Object
    Set info = CreateObject("SymphonyProfiler4WD.WDReservationInfo")
    ' Due to the vagaries of the Worldox API, the PG # you need to specify here is one more than
    ' the number that appears in wdadmin - so the following entry refers to PG 20 as displayed in wdadmin
    info.pgid = 21
    info.Description = "test desc"
    info.field1 = "code1"
    info.field2 = "code2"
    info.field3 = "code3"
    info.field4 = "code4"
    info.field5 = "code5"
    info.field6 = "code6"
    info.field7 = "*WDUSER"

    ' Next, connect to the Symphony Profiler 4 WD application
    Dim app As Object
    Set app = CreateObject("SymphonyProfiler4WD.Application")

    ' Then request that it show the reservation dialog, with the default save as dialog values specified
    ' Info - specifies the values that the Worldox profile should be pre-populated with
    ' Flags - optional parameter - 0 by default
    ' 0 - Another and Another Similar buttons will operate as normal
    ' 1 - Suppress Another Buttons - the Another and Another Similar buttons will be suppressed
    Dim rslt As Long
    rslt = app.ShowReservationDialog(info, 1)

    ' Handle the return code
    ' 1 = OK pressed
    ' 2 = Cancel pressed
    If (rslt <> 2) Then
        Debug.Print "PG = " & info.pgid
        Debug.Print "Path = " & info.Path ' path is Read Only, set to the path of the XPF file after the reservation is created
        Debug.Print "Field1 = " & info.field1
        Debug.Print "Field2 = " & info.field2
        Debug.Print "Field3 = " & info.field3
        Debug.Print "Field4 = " & info.field4
        Debug.Print "Field5 = " & info.field5
        Debug.Print "Field6 = " & info.field6
        Debug.Print "Field7 = " & info.field7
        Debug.Print "Description = " & info.Description
    Else
        Debug.Print "Canceled"
    End If

End Sub
This page was: Helpful | Not Helpful

© 2022 Trumpet, Inc., All Rights Reserved