• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 31. Working with Field Codes and... > Incorporating Form Macros

Incorporating Form Macros

In some cases, you might want an action the user selects to execute a macro you’ve added to the form. You can add a macro to your form template just as you would add a macro to any other document. Here are the steps:

1.
Open the template to which you want to add the macro.

2.
Click the field you want to use, and click Protect Form on the Forms toolbar to unprotect the field.

3.
Double-click the field to display its Form Field Options dialog box.

4.
Select the macro you want to use by making a choice in the Run Macro On section of the dialog box as follows:

  • If you want the macro to execute when the user enters, or selects, the field, click the Entry arrow and choose the macro you want to use from the list. The macros displayed in the list are those that are available in the document you are currently using. (For more information on adding macros to your form, see Chapter 32, “Creating and Working with VBA Macros.”)

  • If you want the macro to execute after the user exits, or deselects, the field, click the Exit arrow and choose the macro from the list, as shown in Figure 31-17.

    Figure 31-17. Choose whether you want Word to execute a macro when the user accesses or exits the field.

5.
Click OK to close the Form Fields Options dialog box and save the settings.

6.
Click the Protect Form button to protect the form once again. The macro is now enabled and will execute according to your selections when the user accesses the field.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint