Show Contents / Index / Search

Create a Macro in the Visual Basic Editor

Whenever possible, create macros in Modules. Doing so will add to the integrity and stability of your program. The exception to this rule is event procedures, which are added directly to Reflection objects.

To create a macro in the Visual Basic Editor

  1. In Reflection, open a session document.
  2. Open the Visual Basic Editor as follows:

    If you are using this "look and feel"

    Do this...

    The Reflection button

    Reflection Ribbon

    From the Tools ribbon, click Visual Basic.

    The Reflection button

    Reflection Browser

    On the Reflection menu, choose Tools, Macro and then Visual Basic.

    The session document appears as a project in the Project Explorer; for example, Project (My Session.rd3x).

  3. In the Project Explorer, select the project in which you want save the macro, and then choose Insert > Module to create a new module.
  4. Double-click the module you created.

    The Code window opens.

  5. Choose Insert > Procedure, type a name in the Name box, and then click OK.

    The name you choose must follow the Visual Basic naming conventions for macros. For further information, see Naming Macros.

  6. Type code for your macro between the Sub (or Public Sub) and End Sub statements.

    Context-sensitive Help is available for Visual Basic commands. Position the insertion point within a command and press F1.