home *** CD-ROM | disk | FTP | other *** search
/ Chip: 25 Years Anniversary / CHIP_25Jahre_Jubilaeum.iso / downloads / 401065 / WPO11 / Data1.cab / _500E0A4C69D245D69DB28377170AFE3E < prev    next >
Text File  |  2003-03-07  |  51KB  |  1,248 lines

  1. Recordings, macros, and automation features
  2.  
  3. WordPerfect lets you create three types of macros:
  4.  
  5.   WordPerfect-is stored in the document it applies to or in a macro library file. Create this macro when your task is contained within WordPerfect.
  6.   
  7.   PerfectScript-is stored with a .wcm filename extension. This macro is useful if you want to interact with other WordPerfect Office applications, such as Quattro Pro and Corel Presentations.
  8.   
  9.   Visual Basic for Applications (VBA)-lets you develop scripts that are saved in specific projects that use a robust version of the Visual Basic programming language. You can access the VBA editor from WordPerfect.
  10.   
  11. You can use macros to perform repetitive or complex tasks automatically. A macro performs a series of instructions. For example, you can create a macro that retrieves a file, gives it a new name, and saves it to another format. You can then play the macro to repeat the action.
  12.  
  13. A macro can consist of keystrokes, programming commands, product commands, and comments.The simplest way to create a macro is to "record" the keystrokes in WordPerfect. You can also write a macro if you want to include non-recordable tasks. (For example, you can define a macro to play until a certain event happens.)
  14.  
  15. In this section, you'll learn about:
  16.  
  17.   using QuickMacros
  18.   
  19.   recording, saving, and storing macros
  20.   
  21.   playing macros
  22.   
  23.   using macros included with WordPerfect
  24.   
  25.   using toolbars for macros
  26.   
  27.   using template macros
  28.   
  29.   editing and deleting template macros
  30.   
  31.   triggering macros from templates
  32.   
  33.   customizing WordPerfect macros
  34.   
  35.   assigning template macros to keystrokes, menus, and toolbars
  36.   
  37.   associating toolbars with template features
  38.   
  39.   writing and editing macros using PerfectScript
  40.   
  41.   understanding macro commands and syntax
  42.   
  43.   using macro conventions and formatting macros
  44.   
  45.   recording macro commands into macros
  46.   
  47.   inserting codes in macros
  48.   
  49.   using macros from earlier versions of WordPerfect
  50.   
  51.   using programming commands in macros
  52.   
  53.   using parameters in macros
  54.   
  55.   using variables in PerfectScript
  56.   
  57.   using the macro command browser
  58.   
  59.   using macro commands to retrieve information
  60.   
  61.   using OLE object commands in macros
  62.   
  63.   compiling macros
  64.   
  65.   working from the PerfectScript utility
  66.   
  67.   testing for errors from PerfectScript
  68.   
  69.   editing and deleting macros
  70.   
  71.   searching in macros
  72.   
  73.   integrating with Microsoft Visual Basic for Applications
  74.   
  75.   using the PerfectScript class to change WordPerfect documents
  76.   
  77.   working with VBA methods
  78.   
  79.   accessing and manipulating applications from other applications
  80.   
  81.   using OLE Automation
  82.   
  83.   understanding OLE Automation
  84.   
  85.   using files with DDE Execute from previous versions of WordPerfect
  86.   
  87.   getting online Help for macros
  88.   
  89. WordPerfect Office contains a minimal set of macros. To access more macros, visit our OfficeCommunity site on the World Wide Web.
  90.  
  91. Using QuickMacros
  92.  
  93. WordPerfect lets you create QuickMacros. A QuickMacro is a temporary macro that you can record without saving. WordPerfect stores a QuickMacro in your computer's memory for the current WordPerfect session only.
  94.  
  95. When you record a new QuickMacro, the existing QuickMacro is replaced. You cannot edit a QuickMacro or save it to a template.
  96.  
  97. To record a QuickMacro
  98.  
  99. 1    Click Tools  Template macro  Record.
  100.  
  101. 2    Click Record without entering a macro name in the Name box.
  102.  
  103. 3    Perform the task you are recording.
  104.  
  105. 4    Click Tools  Template macro  Record to stop recording the macro.
  106.  
  107. Note
  108.  
  109.   WordPerfect records both the keyboard and mouse actions you make; however, you must use the keyboard instead of the mouse to position the cursor in the document window.
  110.   
  111. To play a QuickMacro
  112.  
  113. 1    Click Tools  Template macro  Play.
  114.  
  115. 2    Click Play without entering a macro name in the Name box.
  116.  
  117. Recording, saving, and storing macros
  118.  
  119. Macros automate application tasks. For example, WordPerfect macros automate tasks, such as setting margins, selecting a font, or creating a merge file. Macro tasks consist of instructions, called statements. There are several kinds of statements: assignments, conditions, loops, comments, and commands. For example,
  120.  
  121. MarginLeft (1.0")
  122.  
  123. MarginRight (1.0")
  124.  
  125. are WordPerfect commands that set one-inch left and right margins. Each command represents one instruction or statement. The simplest macro consists of only one statement. Complex macros have hundreds of statements. The sequence of statements determines how a macro performs its tasks.
  126.  
  127. One way to create a macro is to record a task in WordPerfect. When you record a macro, you convert actions into macro commands. These are stored until you need them. Use the fewest number of steps necessary to perform your task.
  128.  
  129. To include programming commands, or non-recordable actions, you must edit the macro after you record it. For more information about editing macros, see "Editing and deleting macros."
  130.  
  131. You can instruct WordPerfect to pause while playing a macro if you want the macro to stop playing. This can be useful if you want to allow users time to type in text when they run the macro. When you play the macro, it runs until it reaches the PauseKey command.
  132.  
  133. WordPerfect allows you to store macros in any folder, including the default and supplemental macros folders. The default macros folder contains the macros with which WordPerfect was shipped. By default, WordPerfect's shipping macros are stored in X:\program files\corel\WordPerfect Office 11\macros\wpwin, where X represents the drive letter. You can use the supplemental macros folder as an additional folder to store macros.
  134.  
  135. To record a macro
  136.  
  137. 1     Click Tools  Macro  Record.
  138.  
  139. A check mark beside the Record command indicates that the command is enabled.
  140.  
  141. 2    Type a name for the macro in the Filename box.
  142.  
  143. 3    Click Record.
  144.  
  145. 4    Perform the actions you want to record.
  146.  
  147. You can also    
  148.  
  149. Pause recording a macro    Click Tools  Macro  Pause.
  150.  
  151. Resume recording a macro    Click Tools  Macro  Pause.
  152.  
  153. Stop recording a macro    Click Tools  Macro  Record.
  154.  
  155. A check mark beside the Pause command indicates that the command is enabled.
  156.  
  157. Notes
  158.  
  159.   A macro is saved with a .wcm filename extension.
  160.   
  161.   If you are recording a new macro, clicking Undo will still retain the step that you tried to undo.
  162.   
  163. To change the default macros folder
  164.  
  165. 1    Click Tools  Settings.
  166.  
  167. 2    Click Files.
  168.  
  169. 3    Click the Merge/macro tab.
  170.  
  171. 4    Click the Browse button in the Default macro folder box.
  172.  
  173. If you want to change the supplemental macros folder, click the Browse button in the Supplemental macro folder box.
  174.  
  175. 5    Choose the drive and folder where you want to store the macros.
  176.  
  177. Playing macros
  178.  
  179. WordPerfect allows you to play and pause the play of macros. You can play a macro to repeat the sequence of steps for a task you want to perform. Before you can play a macro, however, it must be compiled with a compiler. For more information, see "Compiling macros."
  180.  
  181. To play a macro
  182.  
  183. 1    Click Tools  Macro  Play.
  184.  
  185. 2    Choose the folder where the file is stored.
  186.  
  187. 3    Double-click the macro filename.
  188.  
  189. Notes
  190.  
  191.   The Macro submenu displays the last nine macros you have played.
  192.   
  193.   A macro you record may not play properly in every situation. Some macros depend on certain options or settings. When a macro cannot play, a message may display, indicating the reason and the line number(s) in the macro you can check.
  194.   
  195. Tip
  196.  
  197.   You can pause or resume playing a macro by clicking Tools  Macro  Pause.
  198.   
  199. To play a macro multiple times
  200.  
  201. 1    Click Edit  Repeat next action.
  202.  
  203. 2    Type a value in the Number of times to repeat next action box.
  204.  
  205. If you want WordPerfect to use this value as a default, click Use as default.
  206.  
  207. Using macros included with WordPerfect
  208.  
  209. WordPerfect comes with many predefined macros. The macros included with WordPerfect Office can be used as a basis for writing your own macro. For more information, see "Writing and editing macros using PerfectScript."
  210.  
  211. Many of the macros can be played by clicking buttons on the Shipping macros toolbar. For more information, see "Using toolbars for macros." For more information about playing macros, see "Playing macros."
  212.  
  213. Macros included with WordPerfect
  214.  
  215. Macro    Description
  216.  
  217. abbrev.wcm    Lets you insert the expanded forms of QuickWords.
  218.  
  219. adrs2mrg.wcm    Copies the address book (for automated templates) into a merge data file.
  220.  
  221. allfonts.wcm    Creates a document that lists every font available to the current printer and shows sample text in each font.
  222.  
  223. checkbox.wcm    Inserts a check box in the document that you can click to add or remove a check mark.
  224.  
  225. closeall.wcm    Closes all open documents and prompts you to save the modified ones.
  226.  
  227. ctrlm.wcm    Activates the macro command browser.
  228.  
  229. cvtdocs11.wcm    Lets you convert multiple documents from another document type to WordPerfect 11 format.
  230.  
  231. dcconvert.wcm    Converts "whole word" drop caps to "number of characters" drop caps for conversion to Microsoft Word.
  232.  
  233. endfoot.wcm    Converts endnotes to footnotes in the document or selected text. To run this macro, your cursor must be outside of the footnote or endnote box (that is, your cursor must be in the main body of the page).
  234.  
  235. expndall.wcm    Expands all QuickWords in the document.
  236.  
  237. filestmp.wcm    Places the filename and path of the current document in a header or footer.
  238.  
  239. flipenv.wcm    Creates an envelope rotated 180 degrees (text is upside down). On printers with a large trailing margin, this lets you print the return address 0.25" from the edge.
  240.  
  241. fontdn.wcm    Decreases the font size of the selected text by 2 points.
  242.  
  243. fontup.wcm    Increases the font size of the selected text by 2 points.
  244.  
  245. footend.wcm    Converts footnotes to endnotes in the document or in selected text.
  246.  
  247. longname.wcm    Changes the name of selected documents from the DOS (8.3) filename to a long filename based on the document summary description.
  248.  
  249. parabrk.wcm    Inserts symbols or small graphics as paragraph breaks. The graphics are centered on the blank line between paragraphs.
  250.  
  251. pleading.wcm    Creates lines and numbers for pleading documents.
  252.  
  253. prompts.wcm    Helps you create prompts for automated templates.
  254.  
  255. reverse.wcm    Creates white text on black background (or uses other color combinations) in selected text or table cells.
  256.  
  257. saveall.wcm    Prompts you to save open documents.
  258.  
  259. savetoa.wcm    Saves the current document and makes a copy of it on the diskette in drive A.
  260.  
  261. tconvert.wcm    Converts WordPerfect 6.0 templates that used the _autofil.wcm macro.
  262.  
  263. uawp11en.wcm    Used by PerfectExpert. Do not delete this macro from the macros folder.
  264.  
  265. wp_org.wcm    Creates an organization chart in WordPerfect.
  266.  
  267. wp_pr.wcm    Sends a WordPerfect outline to Corel Presentations.
  268.  
  269. Note
  270.  
  271.   In order to run the footend.wcm or endfoot.wcm macros, your cursor must be outside of the footnote or endnote box (that is, your cursor must be in the main body of the page).
  272.   
  273. Using toolbars for macros
  274.  
  275. WordPerfect has toolbars associated with macros, which you can use to: stop, record, play, and pause macros; insert system variables, product commands, and programming commands; save and compile a macro; insert merge and find and replace codes; change how a macro is saved; or close a macro.
  276.  
  277. To view a macro toolbar
  278.  
  279. 1    Click Tools  Settings.
  280.  
  281. 2    Click Customize.
  282.  
  283. 3    In the Customize settings dialog box, click the Toolbars tab.
  284.  
  285. 4    In the Available toolbars list box, enable any of the following check boxes:
  286.  
  287.   Macro tools
  288.   
  289.   Shipping macros
  290.   
  291. To view the Macro toolbar
  292.  
  293.   Click Tools  Macro  Macro toolbar.
  294.   
  295. A check mark beside the Macro toolbar command indicates that the command is enabled.
  296.  
  297. Note
  298.  
  299.   To access commands on the Macro toolbar or the Template macro toolbar, you must press ALT + SHIFT and the letter on the desired button. For example, to access the Codes button command, you must press ALT + SHIFT + O.
  300.   
  301. To view the Template macro toolbar
  302.  
  303.   Click Tools  Template macro  Template macro toolbar.
  304.   
  305. A check mark beside the Template macro toolbar command indicates that the command is enabled.
  306.  
  307. To use the Macro toolbar
  308.  
  309. Click    To
  310.  
  311. Stop    Stop recording or playing a macro
  312.  
  313. Record    Begin recording in the current document
  314.  
  315. Play    Play the current macro
  316.  
  317. Pause    Pause while recording or playing a macro
  318.  
  319. Dialog Editor    Display the editor for customizing dialog boxes
  320.  
  321. Commands    Insert system variables, product commands, and programming commands at the cursor
  322.  
  323. Save & Compile    Save and compile the macro
  324.  
  325. Codes    Insert merge and Find & Replace codes
  326.  
  327. Options    Change how the macro is saved, close the macro, or hide the Macro toolbar
  328.  
  329. Using template macros
  330.  
  331. WordPerfect lets you add macros to a template. Template macros are macros attached to a template and are saved as part of that template file. They can be played only from that template and are not listed with standard macros.
  332.  
  333. There are three ways to add a macro to a template: you can add a template macro from another template; add a macro from a macro file stored on disk; or record a template macro from scratch.
  334.  
  335. You can record macros for specific templates and select specific templates as the default location to which you can record macros. You can only view the macros saved with the current template.
  336.  
  337. You can play a template macro. WordPerfect includes several templates with macros that are ready to use. You can pause a template macro if you need to interrupt the macro you are playing. You cannot play a template macro until you save and exit the template to which it is attached.
  338.  
  339. You can pause while playing a template macro. This can be useful if you want to allow users time to type in text when they run the template macro.
  340.  
  341. To add a template macro from another template
  342.  
  343. 1    Click File  New from project.
  344.  
  345. 2    Choose a category from the Category list box.
  346.  
  347. 3    Choose a template from the Project list box.
  348.  
  349. 4    Click Options  Edit WP template.
  350.  
  351. 5    Click the Copy/remove object button on the Template toolbar.
  352.  
  353. 6    In the Copy/remove template objects dialog box, choose the template that contains the macro from the Templates to copy from list box.
  354.  
  355. 7    Choose Macros from the Object type list box.
  356.  
  357. If you want to add a macro from a macro file stored on disk, choose Macros on disk from the Object type list box, click the Browse button in the Macros on disk area, and choose the drive and folder in which the macro is stored.
  358.  
  359. 8    From the Source list box, choose the macro you want to copy.
  360.  
  361. 9    Click one of the following:
  362.  
  363.   Copy-copies only selected items in the Source list box
  364.   
  365.   Copy all-copies all items in the Source list box
  366.   
  367. Tip
  368.  
  369.   If the Template toolbar is not displayed, click View  Toolbars, and enable the Template check box.
  370.   
  371. To record a template macro from scratch
  372.  
  373. 1    Click Tools  Template macro  Record.
  374.  
  375. 2    Type the name of the macro in the Name box.
  376.  
  377. 3    Click Location.
  378.  
  379. 4    Enable one of the following options in the Macro location dialog box:
  380.  
  381.   Current template-specifies the current template to record a template macro to
  382.   
  383.   Default template-specifies the default template to record a template macro to
  384.   
  385. If you want to record a template macro to the enabled location by default, enable the Use as default check box.
  386.  
  387. 5    Click OK.
  388.  
  389. 6    Click Record.
  390.  
  391. 7    Perform the task you want to record.
  392.  
  393. You can also    
  394.  
  395. Pause a template macro you are recording    Click Tools  Template macro  Pause.
  396.  
  397. Resume recording a template macro    Click Tools  Template macro  Pause.
  398.  
  399. Stop recording a template macro    Click Tools  Template macro  Record.
  400.  
  401. View the macros that are saved with the current template    Click Tools  Template macro  Play.
  402.  
  403. The macros saved with the current template are listed in the Macros in template list box.
  404.  
  405. Note
  406.  
  407.   If you are recording a new macro, clicking Undo does not undo the most recent step performed; you will still retain the step that you tried to undo.
  408.   
  409. To play a template macro
  410.  
  411. 1    Click File  New from project.
  412.  
  413. 2    Choose a category from the Category list box.
  414.  
  415. 3    Choose a template from the Project list box.
  416.  
  417. 4    Click Create.
  418.  
  419. 5    Click Tools  Template macro  Play.
  420.  
  421. 6    Choose a macro from the Macros in template list.
  422.  
  423. The macro name displays in the Name box.
  424.  
  425. 7    Click Play.
  426.  
  427. You can also    
  428.  
  429. Pause a template macro    Click Tools  Template macro  Pause.
  430.  
  431. Resume playing a template macro    Click Tools  Template macro  Pause.
  432.  
  433.   Play a template macro multiple times    Click Edit  Repeat next action, and type a value in the Number of times to repeat next action box.
  434.  
  435. Tip
  436.  
  437.   If you want to use the Number of times to repeat next action value as a default, click Use as default.
  438.   
  439. Editing and deleting template macros
  440.  
  441. By editing template macros, you can add, edit, or delete macro commands. The same rules of syntax and conventions that apply to macros apply to template macros. For more information, see "Writing and editing macros using PerfectScript," "Compiling macros," and "Editing and deleting macros."
  442.  
  443. To edit a template macro
  444.  
  445. 1    Click File  New from project.
  446.  
  447. 2    Choose a template from the Project list box.
  448.  
  449. 3    Click Options  Edit WP template.
  450.  
  451. 4    Click Tools  Template macro  Edit.
  452.  
  453. 5    Choose a template macro from the Macros in template box.
  454.  
  455. 6    Click Edit.
  456.  
  457. 7    Edit any macro commands.
  458.  
  459. 8    Click the Save & compile button on the Template macro toolbar.
  460.  
  461. 9    Click Options  Close macro on the Template macro toolbar.
  462.  
  463. Tip
  464.  
  465.   To display the Template macro toolbar, click Tools  Template macro  Template macro toolbar.
  466.   
  467. To delete a template macro
  468.  
  469. 1    Click Tools  Template macro  Edit.
  470.  
  471. 2    Choose a template macro from the Macros in template box.
  472.  
  473. 3    Click Delete.
  474.  
  475. Note
  476.  
  477.   You cannot delete template macros that are assigned to a toolbar, keyboard, or menu. WordPerfect deletes template macros from a template when you remove them from a toolbar, keyboard, or menu.
  478.   
  479. Triggering macros from templates
  480.  
  481. You can play a macro as you use a template. For example, if you use a template to create letters, you can set a PRE PRINT trigger in the template that runs a spell-check macro. The macro then lets you check the spelling of your letters just before they print.
  482.  
  483. You can use the following macro triggers.
  484.  
  485. Trigger    Description
  486.  
  487. POST CLOSE    Runs in the active window after you close a window.
  488.  
  489. POST NEW    Runs after you open a window by clicking File  New.
  490.  
  491. POST OPEN    Runs after you open a window by clicking File  Open.
  492.  
  493. POST PRINT    Runs after you send a print job to the printer.
  494.  
  495. POST STARTUP    Runs when you start WordPerfect. The macro must be associated with the default template.
  496.  
  497. POST SWITCH DOC    Runs in the active window after you switch from another window.
  498.  
  499. POST TABLES    Runs after you create a table structure in a document, but before you enter data in the table.
  500.  
  501. PRE CLOSE    Runs before you close the active window by clicking File  Close.
  502.  
  503. PRE NEW    Runs in the active window before you open another window by clicking File  New.
  504.  
  505. PRE OPEN    Runs in the active window before you open another window by clicking File  Open.
  506.  
  507. PRE PRINT    Runs after you click File  Print, but before the print job is generated.
  508.  
  509. PRE SWITCH DOC    Runs in the active window before you switch to another window.
  510.  
  511. PRE TABLES    Runs after you insert a table by clicking Insert  Table, but before the table structure is created in the current window.
  512.  
  513. Adding the TemplateFill macro command
  514.  
  515. The TemplateFill() macro command displays a dialog box that lets you enter template data. This dialog box varies depending on the fields required for the current template. If personal information is not specified, this command first prompts you to specify personal information regardless of what data the current template requires. If the current template does not require data other than personal information, and the personal information has been set, this command updates the personal information in the document without displaying the dialog box. If the current document is not based on an automated template, and the personal information has been set, this command does nothing.
  516.  
  517. Only macros that have been added to the template can be used with triggers. A trigger specifies when a macro plays in a template (for example, before you close a document).
  518.  
  519. Macros on disk cannot be associated with a trigger. Running the Prompt Builder associates the POST NEW trigger with <dofiller>, the feature that runs the Prompts dialog box. If the POST NEW trigger is associated with a template macro, use the TemplateFill() macro command in that template macro to activate the DoFiller feature.
  520.  
  521. If you want DoFiller to run when you are using a template macro, you need to add the TemplateFill macro command. The position of this command is important because macro execution is generally sequential. For example, if you want to insert a macro in a template that adds a date code to your document, you need to let the macro place the date code prior to your filling out the template prompts.
  522.  
  523. To insert a macro trigger in a template
  524.  
  525. 1    Click File  New from project.
  526.  
  527. 2    Choose a template from the Project list box.
  528.  
  529. 3    Click Options  Edit WP template.
  530.  
  531. 4    Click the Associate button on the Template toolbar.
  532.  
  533. 5    Enable the Triggers option.
  534.  
  535. 6    Choose a trigger from the Items to associate list box.
  536.  
  537. 7    From the Macros list box, choose the macro you want to associate with the trigger.
  538.  
  539. Note
  540.  
  541.   Only template macros that you have created in that template or copied to that template display in the Macros list box.
  542.   
  543. To add the TemplateFill macro command
  544.  
  545. 1    Click Tools  Macro  Edit.
  546.  
  547. 2    Double-click a filename.
  548.  
  549. 3    Press CTRL + END to place the cursor at the end of the macro document.
  550.  
  551. 4    Press ENTER.
  552.  
  553. 5    Type TemplateFill().
  554.  
  555. 6    Click Save & compile on the Template macro toolbar.
  556.  
  557. 7    Choose the drive and folder where you want to save the macro.
  558.  
  559. 8    Type the filename in the Filename box.
  560.  
  561. 9    Click Options  Close macro on the Template macro toolbar.
  562.  
  563. Customizing WordPerfect macros
  564.  
  565. You can assign macros to keystrokes, menus, toolbars, and the property bar.
  566.  
  567. WordPerfect allows you to edit the name and QuickTips of a button, edit button images, and change the macro triggered by a button.
  568.  
  569. To assign a macro to a keystroke
  570.  
  571. 1    Click Tools  Settings.
  572.  
  573. 2    Click Customize.
  574.  
  575. 3    In the Customize settings dialog box, click the Keyboards tab.
  576.  
  577. 4    Choose a keyboard from the Available keyboards list, and click Edit.
  578.  
  579. If you want to create a keyboard with the same initial settings as an existing keyboard, choose a keyboard, click Create, and type a name in the New keyboard name box.
  580.  
  581. 5    In the Choose a shortcut key list box, choose a key to which you want to assign the template macro.
  582.  
  583. 6    Click the Macros tab.
  584.  
  585. 7    Click Assign macro to key.
  586.  
  587. 8    In the Select macro dialog box, type the filename and path in the Filename box.
  588.  
  589. 9    Click Select.
  590.  
  591. Note
  592.  
  593.   If you save a macro file without its full path, WordPerfect searches for the macro in the default folder, as specified on the Document page of the Files settings dialog box.
  594.   
  595. To assign a macro to a menu
  596.  
  597. 1    Click Tools  Settings.
  598.  
  599. 2    Click Customize.
  600.  
  601. 3    In the Customize settings dialog box, click the Menus tab.
  602.  
  603. 4    Choose a menu from the Available menus list box.
  604.  
  605. 5    Click Edit.
  606.  
  607. 6    Click the Macros tab.
  608.  
  609. 7    Click Add macro.
  610.  
  611. 8    In the Select macro dialog box, type the filename and path in the Filename box.
  612.  
  613. 9    Click Select.
  614.  
  615. You can also    
  616.  
  617. Place the macro in a menu    Drag the new macro item over the menu. The blue line represents the macro.
  618.  
  619. Create a menu with the same initial settings as an existing menu    Click the Menus tab, and choose a menu from the Available menus list. Click Create, and type a name for the new menu in the New menu name box.
  620.  
  621.  
  622.  
  623. To assign a macro to a toolbar button
  624.  
  625. 1    Click Tools  Settings.
  626.  
  627. 2    Click Customize.
  628.  
  629. 3    Choose a toolbar from the Available toolbars list box.
  630.  
  631. 4    Click Edit.
  632.  
  633. 5    Click the Macros tab.
  634.  
  635. 6    Click Add macro.
  636.  
  637. 7    Type the macro path and filename in the Filename box.
  638.  
  639. 8    Click Select.
  640.  
  641. To edit the name and QuickTips of a button
  642.  
  643. 1    Right-click a button, and click Edit.
  644.  
  645. 2    Right-click the button you want to edit, and click Customize.
  646.  
  647. 3    Type text in any of the following boxes:
  648.  
  649.   Button text-edits the text of the button
  650.   
  651.   QuickTip-edits the QuickTips text of the button
  652.   
  653. Note
  654.  
  655.   If you save a macro file without its full path, WordPerfect searches for the macro in the default folder, as specified on the Document page of the Files settings dialog box.
  656.   
  657. To edit the image of a macro button
  658.  
  659. 1    Right-click a button, and click Edit.
  660.  
  661. 2    Make changes in any of the following areas:
  662.  
  663.   Colors-lets you change the color of the button
  664.   
  665.   Drawing mode-lets you choose between changing the image a single pixel at a time or filling the whole area
  666.   
  667.   Zoomed image-lets you re-create the image
  668.   
  669. To assign a macro to the property bar
  670.  
  671. 1    Click Tools  Settings, and click Customize.
  672.  
  673. 2    Click the Property bars tab.
  674.  
  675. 3    Choose a property bar from the Available property bars list box.
  676.  
  677. 4    Click Edit.
  678.  
  679. 5    Click the Macros tab.
  680.  
  681. 6    Click Add macro.
  682.  
  683. 7    Type the macro filename and path in the Filename box.
  684.  
  685. 8    Click Select.
  686.  
  687. 9    Drag the button that represents the macro to the property bar.
  688.  
  689. Assigning template macros to keystrokes, menus, and toolbars
  690.  
  691. You can assign template macros to a keystroke, a menu, and a toolbar button. When you press the assigned keystroke, click a menu item, or click a toolbar button, the macro is launched. You can assign template macros by using macros that you have created or macros that are included with WordPerfect.
  692.  
  693. You can also edit the current menu and create a menu with the same initial settings as an existing menu.
  694.  
  695. To assign a template macro to a keystroke
  696.  
  697. 1    Click File  New from project.
  698.  
  699. 2    Choose a template from the Project list box.
  700.  
  701. 3    Click Options  Edit WP template.
  702.  
  703. 4    Click Tools  Settings, and click Customize.
  704.  
  705. 5    Click the Keyboards tab.
  706.  
  707. 6    Choose a keyboard from the Available keyboards list, and click Edit.
  708.  
  709. 7    Choose a key in the Choose a shortcut key list box.
  710.  
  711. If you want to remove a template macro from a keystroke, choose a key to remove from the template macro from the Choose a shortcut key list box, and click Remove assignment.
  712.  
  713. 8    Click the Macros tab, and click Assign template macro to key.
  714.  
  715. 9    Click a macro in the Macros in template list box, and click Select.
  716.  
  717. To create a keyboard with the same initial settings as an existing keyboard
  718.  
  719. 1    Click File  New from project.
  720.  
  721. 2    Choose a template from the Project list box.
  722.  
  723. 3    Click Options  Edit WP template.
  724.  
  725. 4    Click Tools  Settings, and click Customize.
  726.  
  727. 5    Click the Keyboards tab.
  728.  
  729. 6    Choose a keyboard from the Available keyboards list, and click Create.
  730.  
  731. 7    Type a name for the new keyboard in the New keyboard name box.
  732.  
  733. 8    Click Location.
  734.  
  735. 9    Enable one of the following options:
  736.  
  737.   Current template-saves the keyboard in the current template
  738.   
  739.   Default template-saves the keyboard in the default template
  740.   
  741. To assign a template macro to a menu
  742.  
  743. 1    Click File  New from project.
  744.  
  745. 2    Choose a WordPerfect template, and click Options  Edit WP template.
  746.  
  747. 3    Click Tools  Settings, and click Customize.
  748.  
  749. 4    In the Customize settings dialog box, click the Menus tab.
  750.  
  751. 5    Choose a menu from the Available menus list, and click Edit.
  752.  
  753. 6    Click the Macros tab, and click Add template macro.
  754.  
  755. 7    Choose the template macro from the Macros in template list, and click Select.
  756.  
  757. 8    Click OK.
  758.  
  759. 9    Drag the button that represents the template macro to the menu.
  760.  
  761. To edit the current template menu
  762.  
  763. 1    Right-click the current template menu.
  764.  
  765. 2    Click Settings.
  766.  
  767. 3    Click Edit.
  768.  
  769. To create a template menu with the same initial settings as an existing menu
  770.  
  771. 1    Click File  New from project.
  772.  
  773. 2    Choose a category from the Category list box.
  774.  
  775. 3    Choose a template from the Project list box.
  776.  
  777. 4    Click Options  Edit WP template.
  778.  
  779. 5    Click Tools  Settings, and click Customize.
  780.  
  781. 6    In the Customize settings dialog box, click the Menus tab.
  782.  
  783. 7    Choose a menu from the Available menus list, and click Create.
  784.  
  785. 8    In the Create Menu Bar dialog box, type a name for the new menu in the New menu name box.
  786.  
  787. 9    Click Location, and enable one of the following options:
  788.  
  789.   Current template-saves the menu in the current template
  790.   
  791.   Default template-saves the menu in the default template
  792.   
  793. To assign a template macro to a toolbar button
  794.  
  795. 1    Click File  New from project.
  796.  
  797. 2    Choose a category from the Category list box.
  798.  
  799. 3    Choose a template from the Project list box.
  800.  
  801. 4    Click Options  Edit WP template.
  802.  
  803. 5    Click Tools  Settings, and click Customize.
  804.  
  805. 6    Click the Toolbars tab, enable a toolbar in the Available toolbars list box, and click Edit.
  806.  
  807. 7    In the Toolbar editor dialog box, click the Macros tab, and click Add template macro.
  808.  
  809. 8    In the Select template macro dialog box, click a macro in the Macros in template list box.
  810.  
  811. 9    Click Select.
  812.  
  813. If you want the macro to display in a menu, drag the new macro menu item over the menu of your choice to the position you want. The blue line represents the macro.
  814.  
  815. To edit a toolbar button
  816.  
  817. 1    Right-click any button, and click Edit.
  818.  
  819. If you want to customize a button, make any changes in the Toolbar editor dialog box.
  820.  
  821. 2    Right-click the button you want to edit, and click Customize.
  822.  
  823. 3    In the Customize button dialog box, type text in any of the following boxes:
  824.  
  825.   Button text-edits the text of the button
  826.   
  827.   QuickTip-edits the QuickTips text of the button
  828.   
  829. To edit the image of a toolbar button
  830.  
  831. 1    Right-click any button, and click Edit.
  832.  
  833. 2    Right-click the button you want to edit, and click Customize.
  834.  
  835. 3    In the Image editor dialog box, click Edit, and make changes in any of the following areas:
  836.  
  837.   Colors-allows you to change the color of a button
  838.   
  839.   Drawing mode-allows you to choose between changing the image a single pixel at a time or filling the whole area
  840.   
  841.   Zoomed image-allows you to re-create an image
  842.   
  843. Associating toolbars with template features
  844.  
  845. You can display a specific toolbar when you are working with specific features and macros. Toolbars, menus, and keyboards can be associated with a predefined list of features, which can be activated when the particular feature is used in a document.
  846.  
  847. You can also associate macros with various triggers that execute when a particular event occurs inside WordPerfect. There are 13 predefined triggers that you can associate with macros (for example, PRE NEW, POST NEW, PRE PRINT, and POST PRINT). For a list of macro triggers, see "Triggering macros from templates."
  848.  
  849. To use the Associate button with a template macro
  850.  
  851. 1    Click File  New from project.
  852.  
  853. 2    Choose a category from the Category list box.
  854.  
  855. 3    Choose a template from the Project list box.
  856.  
  857. 4    Click Options  Edit WP template.
  858.  
  859. 5    Click the Associate button on the Template toolbar.
  860.  
  861. 6    Enable the Triggers option.
  862.  
  863. 7    Choose a trigger from the Items to associate list box.
  864.  
  865. 8    Choose a macro from the Macros list box.
  866.  
  867. Note
  868.  
  869.   Only template macros that you have created in that template or copied to that template display in the Template macros list box.
  870.   
  871. Writing and editing macros using PerfectScript
  872.  
  873. PerfectScript macros are the common macro language for all applications in WordPerfect Office. PerfectScript is a command-based language. When you record a macro, you record the results of keystrokes or mouse selections instead of recording the keystrokes themselves. For example, instead of recording each keystroke required to change the top margin of a page to 2" (5.1 cm), the macro records the following command:
  874.  
  875. MarginTop(MarginWidth:2.0")
  876.  
  877. Recording and playing macros can speed up routine tasks, but the real power of macros is tapped when product commands are used together with PerfectScript programming commands. By using product commands and programming commands, the functionality of WordPerfect Office features is combined with the customizing, decision making, and iterative capabilities of a programming language. Using programming commands also makes it possible to include the functionality of other applications.
  878.  
  879. A written macro can include non-recordable statements, which cannot be included in recorded macros, that specify how a macro performs a task. You specify conditions for playing assignments, loops, and programming commands. Writing a macro provides greater flexibility to determine function than recording a macro. You can create a macro in WordPerfect and play it in the application for which it was written.
  880.  
  881. With PerfectScript, you can combine statements to automate routine tasks and simplify large ones. You write the macro using statements, compile the macro, and play the macro.
  882.  
  883. The PerfectScript programming language consists of WordPerfect application commands and functions, and programming statements and functions. PerfectScript can do more than perform your recorded WordPerfect commands-it can extend the functionality of WordPerfect in a number of ways, such as prompting you for input, displaying messages, controlling other Corel and Windows-based applications, and performing and repeating commands. You can also build complete applications or wizards so that, if you have limited experience using WordPerfect, you can still use some of the more complex actions.
  884.  
  885. PerfectScript lets you record, play, compile, and convert macros for all WordPerfect Office applications. PerfectScript starts automatically when you record or play a macro. If you play a macro for an application that is not running, PerfectScript automatically starts the application.
  886.  
  887. Installing the Software Developer's Kit
  888.  
  889. The Software Developer's Kit (SDK) is a set of tools that lets you customize WordPerfect Office applications for commercial or business use. For information about acquiring a WordPerfect Office Software Developer's Kit, visit Corel Solutions Partners.
  890.  
  891. The SDK includes the following components:
  892.  
  893.   online Help for the SDK
  894.   
  895.   OLE automation samples
  896.   
  897.   PerfectScript tools
  898.   
  899.   tools and utilities, including code generation wizards for third-party add-ons to WordPerfect, Quattro Pro, and Corel Presentations; utilities to monitor events in WordPerfect and Corel Presentations; and a file format parsing tool
  900.   
  901. Understanding macro commands and syntax
  902.  
  903. To edit and write macros, you must understand the PerfectScript programming language and the principles of computer programming. For most users, recording macro commands is more efficient than typing commands into the macro. WordPerfect opens a new blank window with another macro bar. After you have recorded keystrokes or commands, WordPerfect returns to the macro you are editing and inserts the newly recorded commands.
  904.  
  905. When you create macros using the macro command browser, the macro commands appear in a separate document, numbered. The first line of the macro identifies the program and default language that it uses. The remainder of the macro performs the reported instructions.
  906.  
  907. For more information about macro commands, see "Using macro conventions and formatting macros."
  908.  
  909. Understanding components of macro commands
  910.  
  911. Macro commands consist of four parts: a command name, parameters, enumerations, and separators. The table and example below display and describe these elements of syntax.
  912.  
  913. Macro command component    Description
  914.  
  915. Command name    Indicates which feature the command activates. Some commands consist only of a command name, such as FileOpenDlg().
  916.  
  917. Parameters    Provides more information about the command, such as which options of a feature are active. Parameters are always enclosed in parentheses; for example, Backup (State:On!).
  918.  
  919. Enumerations    Sets the value of a parameter (for example, State: On! or State: Off!). Enumerations always end with an exclamation point.
  920.  
  921. Separators    Marks the parameters in a command. Semicolons separate individual parameters; parentheses enclose a series of parameters; and braces enclose a series of repeating parameters.
  922.  
  923. For example:
  924.  
  925. MakeItFit (TargetPage:1;{Adjust: FitLeftMargin!};{Adjust: FitLineSpacing!})
  926.  
  927. The command in the above example has two parameters: TargetPage and Adjust. They are separated by a semicolon. Adjust is a repeating parameter with two enumerations specified: FitLeftMargin and FitLineSpacing. All the Adjust parameters are enclosed in braces to group them.
  928.  
  929. When you create macros using the macro command browser, the commands are inserted in the correct format. If you type a macro without the macro command browser, you must arrange macro commands and their elements in a precise order or syntax. Each macro command must be spelled correctly and must include all the required parameters and separators.
  930.  
  931. Using types of macro commands
  932.  
  933. There are three types of macro commands: product commands, OLE object commands, and programming commands. Product commands are specific to a product, such as WordPerfect or Quattro Pro. OLE object commands perform tasks on an OLE object. Programming commands work across applications; they are PerfectScript commands.
  934.  
  935. Command names often describe an action, such as Font, MarginLeft, Advance, and FootnoteOption, in WordPerfect; AlignObjectsLeft, BitmapBlur, SelectAllObjects, and ToolbarCopy in Corel Presentations; or Range in Microsoft Excel. Command names are not case sensitive and usually do not contain spaces. Exceptions include programming commands that call a subroutine, such as Case Call or OnCancel Call.
  936.  
  937. A macro can use more than one application product and OLE object. Commands to the non-default application or OLE object require a prefix, which is specified in an application or object statement. For example,
  938.  
  939. A1.AboutDlg ()
  940.  
  941. A1 (followed by a period) is the prefix. It tells the compiler to use the application or Object assigned A1 in a PerfectScript application or Object statement.
  942.  
  943. Understanding syntax
  944.  
  945. Syntax refers to the grammatical rules that govern the form of macro statements and expressions. For example, the syntax of the following statement, which types "John Doe," is correct:
  946.  
  947. Type(Text: "John Doe")
  948.  
  949. The syntax of the next example is incorrect and produces an error message because the statement lacks a closing parenthesis:
  950.  
  951. Type(Text: "John Doe"
  952.  
  953. If you find it difficult to distinguish different parts of a macro, remember that you can add extra line spaces, tabs, and even font changes to make the macro more readable. As long as the commands are written correctly, the macro compiler ignores extra spaces and lines.
  954.  
  955. Using macro conventions and formatting macros
  956.  
  957. When you create macros in WordPerfect, you must follow macro conventions for the macro to compile properly. However, you do not need to observe macro formatting conventions for a macro to compile correctly. These conventions are designed to improve the readability of your macro.
  958.  
  959. Macro conventions
  960.  
  961. Macro command syntax must be correct for a macro to compile. Understanding the following conventions used in WordPerfect macros will help you avoid common syntax errors:
  962.  
  963. You can enter programming commands in uppercase, lowercase, or mixed case. The compiler is not case sensitive. Product commands, such as AboutDlg or AddSlide, are shown in mixed case. WordPerfect system variables begin with ?, such as ?TextColorRed or ?FontUnderline. They are shown in mixed case, and they return information about the application environment.
  964.  
  965. Line wrapping does not affect macro execution. You should not insert spaces in a command name unless the space is part of the syntax. Do not use hard returns, tabs, or indents in a character expression (a character string enclosed in double quotation marks). You can use spaces, tabs, indents, and hard returns before and after commands, or between parameters, to make a macro easier to read. SmartQuotes in a macro create a compile-time syntax error. For more information about SmartQuotes, see "Editing quotation marks."
  966.  
  967. Formatting macros
  968.  
  969. You can type commands into a macro that is saved in a file or in a template. If you want to improve the readability of a macro, you can format it so that it includes tabs, spaces, and even font or text appearance changes. Formatting the macro does not affect how it works. For example, WordPerfect records the following macro in this format:
  970.  
  971. PosDocBottom()
  972.  
  973. Type(Text:"Sincerely")
  974.  
  975. HardReturn()
  976.  
  977. HardReturn()
  978.  
  979. HardReturn()
  980.  
  981. HardReturn()
  982.  
  983. Type(text:"Mrs. Jane Doe")
  984.  
  985. HardReturn()
  986.  
  987. Type(Text:"Vice President, Marketing")
  988.  
  989. However, if you type the commands yourself or edit an existing macro, you can format the macro the way you want. For example, you can format it as follows:
  990.  
  991. PosDocBottom()
  992.  
  993.  
  994.  
  995. Type(Text:"Sincerely")
  996.  
  997.  
  998.  
  999. HardReturn()
  1000.  
  1001. HardReturn()
  1002.  
  1003. HardReturn()
  1004.  
  1005. HardReturn()
  1006.  
  1007.  
  1008.  
  1009. Type(text:"Mrs. Jane Doe")
  1010.  
  1011.  
  1012.  
  1013. HardReturn()
  1014.  
  1015. Type(Text:"Vice President, Marketing")
  1016.  
  1017. Recording macro commands into macros
  1018.  
  1019. WordPerfect lets you record macro commands in a macro.
  1020.  
  1021. To record macro commands in a macro
  1022.  
  1023. 1    Click where you want to insert the macro command.
  1024.  
  1025. 2    Click Tools  Macro  Record.
  1026.  
  1027. 3    Type a name for the macro in the Filename box.
  1028.  
  1029. 4    Click Record.
  1030.  
  1031. A blank document displays.
  1032.  
  1033. 5    Perform the actions you want to record.
  1034.  
  1035. 6    Click the Stop button on the Macro toolbar.
  1036.  
  1037. WordPerfect returns you to the macro document with the new macro command you recorded inserted.
  1038.  
  1039. Inserting codes in macros
  1040.  
  1041. When you insert a code in a macro, you must use straight double quotation marks around the code so that WordPerfect recognizes the code in the macro.
  1042.  
  1043. To insert a code in a macro
  1044.  
  1045. 1    Click Tools  Macro  Macro toolbar.
  1046.  
  1047. 2    Click Codes on the Macro toolbar.
  1048.  
  1049. 3    Click one of the following tabs:
  1050.  
  1051.   Search-allows you to select search find codes
  1052.   
  1053.   Merge-allows you to select merge find codes
  1054.   
  1055.   Date-allows you to select date find codes
  1056.   
  1057.   Other-allows you to select chapter, page, section page, total page, and volume number find codes
  1058.   
  1059. 4    Choose a code from the Find codes list.
  1060.  
  1061. 5    Click Insert.
  1062.  
  1063. 6    Click Close.
  1064.  
  1065. Using macros from earlier versions of WordPerfect
  1066.  
  1067. You can update macros from earlier versions of WordPerfect. The structure of the macro language has not changed for WordPerfect versions 6 through 11. While later versions of the macro language include access to new WordPerfect features and some new commands for accessing existing features, most of the older product commands have been retained to maintain macro compatibility. Because some older product commands have changed, macros from versions 6 through 10 might need minor corrections when you compile them for the first time.
  1068.  
  1069. To update macros from earlier versions of WordPerfect
  1070.  
  1071. 1    Click Tools  Macro  Edit.
  1072.  
  1073. 2    Choose a macro.
  1074.  
  1075. 3    Click Edit.
  1076.  
  1077. 4    Make any changes.
  1078.  
  1079. 5    Click Save & compile on the Macro toolbar.
  1080.  
  1081. 6    Note any errors listed by the macro compiler and make changes as needed.
  1082.  
  1083. Using programming commands in macros
  1084.  
  1085. Programming commands work across WordPerfect Office applications. They control macro functions by
  1086.  
  1087.   specifying conditions under which other macro commands or statements operate (for example, Case, IfElse, Endif, Switch, and EndSwitch)
  1088.   
  1089. For example,
  1090.  
  1091. If (x = "A")
  1092.  
  1093. LineHeightDlg
  1094.  
  1095. Else
  1096.  
  1097. LineSpacingDlg
  1098.  
  1099. Endif
  1100.  
  1101. displays the Line height dialog box in WordPerfect if x equals the value "A". If x has another value, the subroutine displays the Line spacing dialog box. The If, Else, and Endif commands are programming commands. LineHeightDlg and LineSpacingDlg are product commands.
  1102.  
  1103.   repeating macro commands or statements a specified number of times or until certain conditions are met (for example, For, Endfor, Repeat, Until, While, or EndWhile)
  1104.   
  1105.   invoking or jumping to a specified subroutine with Call or Go
  1106.   
  1107. Programming commands and product commands are not case sensitive.
  1108.  
  1109. You can add blank lines to separate programming commands and subroutines, and you can indent lines to show levels of nested commands. Some macro commands cannot be recorded. You must type or insert them using the macro command browser. For information about the macro command browser, see "Using the macro command browser."
  1110.  
  1111. Using parameters in macros
  1112.  
  1113. Commands often require parameters, which are constant values (data). Parameters are passed to the compiler (which translates the macro so that it can be played in the application) or passed between subroutines. In this WordPerfect command,
  1114.  
  1115. Advance (Where: AdvanceDown!; Amount: 1.0")
  1116.  
  1117. Advance is the command name, Where and Amount are parameters, and AdvanceDown! and 1.0" are parameter data. This command advances the cursor down one inch. Parameter names, such as Where and Amount, are optional.
  1118.  
  1119. Data types
  1120.  
  1121. A data type represents information that is needed by a parameter or returned by a command (return value).
  1122.  
  1123. In the command syntax, data types are displayed in italics. For example, the enumerations for the Rotation parameter of BoxCaption Rotation are Degrees90!, Degrees180!, Degrees270!, and None!. Only these enumerations can replace the data type in the command syntax. Enumerations are identified by a trailing exclamation point. The most common data types in product commands are string, enumeration, and numeric. Programming commands frequently use variables.
  1124.  
  1125. Parameter names
  1126.  
  1127. Using parameter names is optional. For example, InhibitInput (State: Off!) works just like InhibitInput (Off!). Some product commands have no parameters. Their syntax is usually written with empty parameters, such as PosScreenUp (). Some programming commands and all system variables have no parameters. Their syntax is the command name alone, such as Pause and ?FeatureBar.
  1128.  
  1129. Italics
  1130.  
  1131. Italics in macros syntax indicate parameter names or types to be replaced with data. For example, the syntax of GraphicsLineLength is:
  1132.  
  1133. GraphicsLineLength (Length: measurement)
  1134.  
  1135. After you replace measurement with a number, the command might be:
  1136.  
  1137. GraphicsLineLength (Length: 21)
  1138.  
  1139. or
  1140.  
  1141. GraphicsLineLength (21)
  1142.  
  1143. Punctuation
  1144.  
  1145. You must enclose parameters in parentheses. A missing parenthesis is a common error that prevents macros from compiling. Parentheses are optional for commands without parameters, but must be used with user-defined functions and procedures.
  1146.  
  1147. Spaces between command names and the opening parenthesis of the parameter section, and after semicolons in parameters, are optional.
  1148.  
  1149. You must separate multiple parameters with semicolons (;). If you omit an optional parameter, include the semicolon in the syntax to keep following parameters in their correct positions. For example,
  1150.  
  1151. AbbreviationExpand (AbbreviationName:; Template: PersonalLibrary!)
  1152.  
  1153. or
  1154.  
  1155. AbbreviationExpand (; PersonalLibrary!)
  1156.  
  1157. Repeating parameters are enclosed in braces and are separated by semicolons. For example,
  1158.  
  1159. CASE (<test>: any ; {<Case>: any; <Label>: label; <Case>: and; <Label>: label...})
  1160.  
  1161. When data is supplied, the command could be
  1162.  
  1163. CASE (vChoice; {1; Exclaim; 2; Info; 3; Question; 4; Stop; 5; QuitMacro}; QuitMacro)
  1164.  
  1165. Product commands perform product tasks in a specific application. For example,
  1166.  
  1167. ShowSlide(Slide: 4)
  1168.  
  1169. displays the fourth slide in the current slide show in Corel Presentations.
  1170.  
  1171. Product commands are specific for each application. They perform various functions in that application, such as
  1172.  
  1173.   displaying a dialog box, InitialCodesStyleDlg
  1174.   
  1175.   specifying settings, such as styles, BorderBottomLine; user settings, PrefZoom; or attributes, Font
  1176.   
  1177.   enabling and disabling features, InhibitInput or TableCellIgnoreCalculation
  1178.   
  1179.   performing actions, such as inserting a file, FileInsert or code, PrinterCommand; renaming a bookmark BookmarkRename; converting comments to text CommentConvert; or moving the cursor PosColBottom
  1180.   
  1181.   playing macros that are included with the application AddressMergeShippingMacro
  1182.   
  1183. Product commands that report information (return value) about the state of an application or feature are sometimes called system variables. In WordPerfect, system variables begin with a leading question mark, ?ColumnWidth. In Corel Presentations, they begin with a leading Env (EnvPaths). Some system variables in Corel Presentations have parameters as well as return values.
  1184.  
  1185. Product commands and programming commands are not case sensitive.
  1186.  
  1187. Using variables in PerfectScript
  1188.  
  1189. A variable acts as a place holder that represents a value, which can be text, numbers, or measurements, that you can use repeatedly in a macro. You can change or manipulate this value in the macro. WordPerfect allows you to use the commands, such as Constant, Declare, Global, Indirect, Local, and Persist, to create variables with different functions and actions.
  1190.  
  1191. Variables are typically preceded by the letter "v".
  1192.  
  1193. To assign a variable in PerfectScript
  1194.  
  1195.   Type the Assign macro command where you want to define the variable.
  1196.   
  1197. For example, type Assign (vName;"Lori") to assign the text "Lori" to the variable "vName".
  1198.  
  1199. Tip
  1200.  
  1201.   You can type a colon followed by the equals sign (:=) as a shortcut to assigning a variable. For example, you could type vName:="Lori" for the above example.
  1202.   
  1203. Using the macro command browser
  1204.  
  1205. The macro command browser helps you insert macro product and programming commands in WordPerfect Office macros.
  1206.  
  1207. Product commands perform tasks that let you use WordPerfect Office features in macros. Many product commands require you to specify parameters and enumerations, which give the applications information about which options to use in dialog boxes and whether to hide or display certain features (for example, the ruler). You can use the macro command browser to specify the commands quickly.
  1208.  
  1209. To access macro commands
  1210.  
  1211. 1    Click Tools  Macro  Macro toolbar.
  1212.  
  1213. 2    Click the Commands button on the Macro toolbar.
  1214.  
  1215. The PerfectScript commands dialog box displays.
  1216.  
  1217. To insert commands with the macro command browser
  1218.  
  1219. 1    Click Tools  Macro  Macro toolbar.
  1220.  
  1221. 2    Click the Commands button on the Macro toolbar.
  1222.  
  1223. 3    Choose a product from the Command type list box.
  1224.  
  1225. 4    Choose items from any of the following list boxes:
  1226.  
  1227.   Commands
  1228.   
  1229.   Parameters
  1230.   
  1231.   Enumeration
  1232.   
  1233. 5    In the Command edit box type any additional parameters you need.
  1234.  
  1235. 6    Click Insert.
  1236.  
  1237. 7    Click Close.
  1238.  
  1239. Notes
  1240.  
  1241.   You can also insert system variables with the macro command browser. System variables contain current system information, such as the current chart type or the default directory. In WordPerfect, system variables begin with a question mark.
  1242.   
  1243.   A parameter that is displayed in bold is a required parameter. The macro will not compile or run without it. 
  1244.   
  1245.  
  1246.  
  1247.  
  1248.