InfoConnect VBA Guide
Key Concepts / Using Extra! Macros
In This Topic
    Using Extra! Macros
    In This Topic

    You can run Extra! macros in InfoConnect. You can also use tools provided by InfoConnect to edit Extra! Basic macros.

    Some properties and methods are not supported. If the macro contains unsupported objects, its functionality may be limited or it may not run.

    Running Extra! Macros

    Editing Extra! Macros

    Running Extra! Macros

    You can open a settings file in the workspace to run the macros it contains, or you can run macros from an external file. InfoConnect supports the Extra! (.ebm) macro file format.

    Note: Extra! macro options are available only if compatibility features are installed.

    To run a macro from an external file

    1. On the InfoConnect button, select InfoConnect Workspace Settings.
    2. Under Trust Center, select Set up API and Macro Security.
    3. In the Legacy API Preference list, select Extra!.
    4. Close the workspace and then reopen it.
    5. Open a session.
    6. On the Session ribbon, from the Macros group, click Run Macro.
    7. From the Run Macro dialog box, select Extra! macro.
    8. Browse to the macro file that you want to run and click OK..

    Editing Extra! Macros

    If you need to make changes to your Extra! macros (.ebm), you can edit them using the Extra! Basic Editor.

    Then, edit the HostOptions properties in the macro to make the macro work with InfoConnect.

    Before you distribute any type of legacy macro, review the Unsupported Extra! Methods and Properties and remove any references to unsupported objects that throw exceptions.

    Edit HostOptions Properties

    If your macro uses the HostOptions object, you will need to edit the HostOptions properties.

    Extra! macros and Visual Basic applications that contain parameterized properties cause an error to occur in InfoConnect. When you run the macro or application, the HostOptions object returns the error "Method or property not found" if it encounters one of the following parameterized properties: AttributeForeground, AttributeBackground, or Color.

    InfoConnect is based on C# and doesn't support parameterized properties; therefore, statements that get and set these properties will have no effect. To avoid this problem, replace the parameterized properties with an equivalent form.

    To edit the property

    1. Start the Extra! Basic Editor.
    2. Open the macro.
    3. Replace the AttributeForeground, AttributeBackground, and Color properties using one of the following equivalent forms:
      • HostOptions.set_[property] x, y
      • y = HostOptions.get_[property]

      For example, change

      HostOptions.AttributeForeground(x) = y

      to

      HostOptions.set_AttributeForeground x, y

      -or-

      y = HostOptions.get_Attribute Foreground x

     

    See Also