Using Scripts and Forms

In most applications, the following variables are automatically defined:
  • Application (and its members)

    Represents the top-level object in the application. All the members of the Application object are also accessible.

  • ScriptEngine

    Represents the running script engine. Its members include the functions defined in your script. This is especially useful for setting the CommandBarButton.Target property.

    Note:

    You should use ScriptThis instead of ScriptEngine when configuring menu and accelerator handlers in IDE.

  • Form (or the ID property of the form if you've changed it with the form's Properties dialog box)

    Represents the running form (a window, such as a dialog box).

You can reference these objects without qualifying with a container object. For example, in a script you can refer to Visible, rather than Application.Visible.