‘To access a COM-enabled application, you must create a reference to its type library. This reference tells Dexterity where to look for the necessary COM information as you are developing your application. You can add a library reference once for an entire dictionary, or you can add a reference that applies only to the current script.
Use the Library Definition window to add a COM type library reference to the current dictionary.
In the Resource Explorer, choose Libraries in the Base group for the current dictionary. Click the New button in the Resource Explorer to create a new library reference.
Choose COM Type Library as the library type to be added.
Click the Name lookup button to open the COM Type Libraries window, which lists all of the type libraries that have been registered on the current machine. Select the appropriate library and click Select.
If the type library file hasn’t been registered, click the Path lookup button in the Library Definition window. Use the File dialog to select the type library file for the application you want to reference.
Click OK to save the type library reference.
Once the type library reference has been added to the dictionary, the Data Type Definition window, and all scripts in the application will be able to access the information in the type library.
To add a type library reference to a specific script, you will use the import statement. This statement creates a reference to the specified type library file, allowing the current script to access the methods, properties, and other items described in the type library file.
Typically, you would use the import statement only if you were using the COM functionality in a limited number of scripts in your application, or were using pass-through sanScript. In all other cases, we recommend creating a type library reference for the entire dictionary.