Attaching macros to notebooks and buttons

Quattro Pro lets you attach macros to notebooks. A macro attached to a notebook can play when you open or close the notebook.

You can also attach a macro to a button. The button plays the macro. You can link a button you create to a macro script.

You can attach a macro to a keystroke. Macros attached to keystrokes are activated when you press the keystroke.

You can use the macro buttons you create to display the dialog boxes you create in Quattro Pro. For information about creating dialog boxes, see “Using custom dialog boxes and controls.”

Once you create a macro button, you can change the button properties by modifying the box type, border color, protection, and button name.

You can also attach a Quattro Pro or PerfectScript macro to a customized a command. For example, you can create a toolbar button and display it on any of the toolbars. When you click the button, the macro executes.


To attach a macro to a notebook

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Right-click the top-left cell of the macro.
2.
 
Click Name cells.
3.
 
Type one of the following in the Name box:
_nbstartmacro — creates a startup macro that plays when you open the notebook
_nbexitmacro — runs a macro when you close the notebook
any block name (for example, “Fred” could be the name of a macro stored in a block)
4.
 
Click Add.
5.
 
Click Close.

Wordperfect Quattro Pro tip Attaching macros to notebooks and buttons

 
You can also create a startup macro that plays when you open the notebook by typing (backslash zero).

To create a macro button

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Click Insert Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Form control Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Push button.
2.
 
Click the spreadsheet.
3.
 
Drag the button to position it on the spreadsheet.

You can also
Display a label on a macro button
Right-click the button, and click Selection properties. Click the Label text tab. In the Enter text box, type the text you want to display on the button.
Attach a macro button to a URL address
Right-click the button, and click Selection properties. Click the Macro tab. Click Link to URL. In the Button URL dialog box, type the URL address in the URL box.

Wordperfect Quattro Pro tip Attaching macros to notebooks and buttons

 
Clicking the spreadsheet creates a button at the default size. If you want to create a custom size button, drag to create the button.
 
You can also create a macro button by opening the Form Controls flyout Wordperfect Quattro Pro pgx form control flyout Attaching macros to notebooks and buttons on the Drawing tools toolbar and clicking the Push button Wordperfect Quattro Pro pgx ctpush Attaching macros to notebooks and buttons tool.

To link a button to a macro

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Right-click a button, and click Selection properties.
2.
 
Click the Macro tab.
3.
 
In the Enter macro box, type { (an opening brace), the macro command name, and } (a closing brace).

Wordperfect Quattro Pro note Attaching macros to notebooks and buttons

 
The maximum length for a macro command name is 200 characters.

To attach a macro to a keystroke

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Select the starting cell of the macro.
2.
 
Click Insert Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Name Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Name cells.
3.
 
In the Name box, type (an apostrophe) and \ (a backslash), followed by a letter of the alphabet.
4.
 
Click Add.

Wordperfect Quattro Pro note Attaching macros to notebooks and buttons

 
Macros assigned to keystrokes play by holding down Ctrl + Shift and the letter assigned to the name. Avoid using the same alphabet letters already assigned to shortcuts in the application. For more information on keyboard shortcuts, see “Using shortcut keys and startup switches.”

To link a macro button to a dialog box

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Right-click the macro button, and click Selection properties.
2.
 
Click the Macro tab.
3.
 
Click Execute dialog.
4.
 
In the Execute dialog dialog box, choose a dialog box from the Active dialog list.
5.
 
Type a cell reference in the Result cell box.
After the dialog box is closed, this cell contains 1 or 0. The value 1 means the dialog box was closed by clicking OK; the value 0 means it was closed by clicking Cancel.
6.
 
Type a cell reference in the Values range box:
Specify the cells that contain initial settings for the dialog box. When the dialog box is closed, its final settings are written into these cells.

Wordperfect Quattro Pro tip Attaching macros to notebooks and buttons

 
You can also select a cell reference by clicking the Range picker Wordperfect Quattro Pro pgx btnpoint Attaching macros to notebooks and buttons tool.

To modify a macr
o button

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Right-click a macro button, and click Selection properties.
2.
 
Click one of the following tabs:
Border color — changes the color around the outside of the button
Box type — changes the thickness of the line around the button or applies a shadow effect
Protection — locks the button, preventing users from moving or changing the button when protections are set at the spreadsheet level
Object name — changes the button’s name (used when referring to the button in a macro)
Print — enables the printing of chart objects on the spreadsheet.
Label text — changes the name displayed on the label
Macro — changes the button activation, URL link, or dialog box that displays when clicking the button
3.
 
Modify any settings.

To attach a macro to a toolbar button

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Click Tools Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Customize.
2.
 
In the list of categories, double-click Workspace, Customization, and click Commands.
3.
 
Choose Macros from the list box.
4.
 
Choose a button graphic from the list.
5.
 
Click the Macro command category tab.
6.
 
Enable one of the following options:
Quattro Pro macro
PerfectScript macro
7.
 
Type the macro in the Enter macro box.
8.
 
Click the Appearance tab, and type a name in the Caption box.
9.
 
Click the General tab, and type text to use as the button’s Tool Tip in the Tooltip help box.

To add a macro button to the toolbar area

Wordperfect Quattro Pro btnbacktotopproc Attaching macros to notebooks and buttons
1.
 
Click Tools Wordperfect Quattro Pro onestep Attaching macros to notebooks and buttons Customize.
2.
 
In the list of categories, double-click Workspace, Customization, and click Commands.
3.
 
Choose Macros from the list box.
4.
 
Select a macro button you want to add to the toolbar area.
5.
 
Drag the macro button to the appropriate toolbar.

Attaching macros to notebooks and buttons