Gordon McComb

WordPerfect for Windows Macro Tutor

Table of Contents

Chapter 1: What Macros Are All About

  • Macros Are Shortcuts
  • Where the Word "Macro" Comes From
  • Macros Can Be Recorded or Programmed
  • Knowing When to Use Macros
  • Should You Use a Macro, or Some Other Feature?
  • Other Features That Are Helpful
  • Teaming Up the Automation Features of WordPerfect

Chapter 2: Recording and Playing Macros

  • Getting Ready for Recording
  • Recording a Macro
  • Playing a Macro
  • If You Make a Mistake While Recording
  • Giving Names to Macros
  • Avoiding Common Macro Problems

Chapter 3: Different Ways to Play Macros

  • Playing the Last Macro
  • Adding a Macro to the Toolbar
  • Assigning a Macro to a Menu
  • Assigning a Macro to the Keyboard

Chapter 4: Editing and Printing Your Macros

  • Recording a Sample Macro
  • Opening the Italsent.wcm Macro
  • Understanding the Macro Property Bar
  • A Brief Discussion of the Innards of a Macro
  • Watch Out For Mistakes!
  • Adding a Comment to the Macro
  • Saving Your Changes
  • Printing a Macro
  • Viewing Macros Without Opening Them
  • Viewing and Printing the "Shipping Macros"

Chapter 5: Important Macro Concepts

  • Commands: Macros Are Made of These
  • Understanding Syntax
  • Entering Commands
  • Using Parameter Names
  • Using the Macro Tools Toolbar
  • The Concept of Compiling
  • Using Macros in Templates
  • Getting Help on Macros
  • What About Visual Basic for Applications Macros?

Chapter 6: Creating Macros That Pause for User Input

  • Creating a Fax Cover Sheet with Pauses
  • Creating a Letter Opener Macro and Adding Pauses
  • Using a Different Key/Action to Unpause the Macro
  • Telling the User What to Do When a Macro Is Paused

Chapter 7: How to Use Variables

  • What Is a Variable
  • Creating and Using Variables
  • Using Variables To Collect Lots of Data
  • Saving Space with the BARLAB2.WCM Macro
  • Building a More Elaborate Variable Collection Macro
  • Stuff You Can Store in a Variable
  • Assigning Variables Within a Macro

Chapter 8: Getting Information from the User

  • GetString: The All-purpose Data Picker-upper
  • Using GetNumber to Store Number Values
  • Using GetUnits to Store Measurement Values
  • Displaying a Menu of Choices

Chapter 9: Asking WordPerfect What It's Doing: All About System Variables

  • What Is a System Variable
  • List of Commonly Used System Variables
  • System Variable Sampler Macro
  • A Practical Macro for Inserting the Filename

Chapter 10: Inserting Information Into a Document

  • Inserting Text: An Overview of the Type Command
  • Positioning the Insertion Point
  • Selecting Text in the Document
  • Removing Text Already in the Document
  • Working Inside Tables
  • Sample Text for the Test Macros in This Chapter

Chapter 11: Displaying Messages to the User

  • In Review: Using MacroStatusPrompt
  • Using the Prompt Command
  • Using the MessageBox Command
  • Message Example: Saving All Documents
  • Message Example: Showing the Time

Chapter 12: Controlling the Flow of Macros

  • Creating "Zones" In Your Macros
  • Referencing a Label
  • Using Labels for "Condition Trapping"
  • Call Example: A Macro to Select Printing Options

Chapter 13: Macros That Make Decisions: Using the If Command

  • The Anatomy of the If Command
  • Commands for True Or False, But Not Both
  • Getting to Know Operators
  • Real World If: The TWOKEY.WCM Macro
  • Nesting If's
  • Testing More than One Condition

Chapter 14: Other Ways to Make Decisions: Using Switch

  • The Makeup of a Switch Structure
  • Providing for a Default Result
  • Testing for Numeric Matches
  • Using Multiple Commands for a CaseOf Match
  • Using Switch with Menu
  • Getting Fancy with the Continue Command
  • Going or Jumping to Other Parts of the Macro
  • A Practical Example of the Switch Statement

Chapter 15: Over and Over Again: Making Macros Repeat Commands

  • Why and When to Use Loops
  • Using ForNext
  • Using ForEach

Chapter 16: More of the Same: Other Ways to Repeat

  • Using the While Command
  • Using A Loop with a Counter
  • Using Repeat/Until
  • Using Repeat/Until with Searches
  • Using Repeat/Until to Assure Proper User Input

Chapter 17: Working with Text Strings

  • A String is Just a Collection of Characters
  • Inserting a String into a Document
  • Counting the Length of a String
  • Retrieving Just a Portion of a String
  • Determining the Location of a Given Character
  • A Practical Example of StrPos and SubStr
  • Converting String Case

Chapter 18: Creating Custom Dialog Boxes

  • Accessing the Dialog Editor
  • Creating a New Dialog Box
  • Adding a Control
  • Setting Control Properties
  • Resizing and Positioning the Dialog Box
  • Testing the Dialog Box
  • Saving the Dialog
  • Exiting the Dialog Editor
  • Enhancing the Basic Dialog Box
  • Connecting the Dialog with the Rest of the Macro

Chapter 19: "How Do I…?"

  • Play a Macro When Starting WordPerfect
  • Display the Files In a Specific Directory
  • Check If a File Exists
  • Delete a File On Disk
  • Copy a File on Disk
  • Close All Files At Once
  • Save All Files At Once
  • Save a File With a Random Name
  • Specify a Directory, Name, and Format for Saved Files
  • Save a File With a New Name and Delete the Original
  • Append the Network User Initials To All Saved Files
  • Check if a Document Is "Blank"
  • Close or Clear a Document Without Saving
  • Save a Document Then Close
  • Insert the Document Name in the Document
  • Check If The Insertion Point Is at the End of the Document
  • Check If The Insertion Point Is at the Beginning of the Document
  • See If One Or More Characters Is in a String
  • Compare Two Strings Without Regard to Case
  • Run Programs from Within WordPerfect
  • Create a Temporary "Scratchpad" to Write Text
  • Ask the User a Question
  • Limit the Length of Text for the GetString Command
  • Limit Entry To Numbers Only
  • Accept Upper or Lower Case Responses to a Prompt
  • Display a Prompt in the Status Bar
  • Make the Macro Wait
  • Ring the Bell
  • Recover From Failed Searches
  • Recover from Errors
  • Recover from the Cancel Key
  • Ignore Not Founds, Errors, and Cancels
  • Share Variables Between Macros
  • Transferring Document Text to a Macro Variable
  • Change the Case of the Next Character

Appendix A: Using the Applications Archive