Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2022 by Barry MacDonnell. All Rights Reserved.

Page updated Aug 21, 2021

Convert Case ("toggle case") - a macro that converts the word under (or to the left of) the cursor, or the words you  selected, into one of these formats -

Initial Capitals for the Main Words ('Title Case')
Initial Capitals For All The Words
Initial capitals for first word only ('Sentence case')
• lower case for all the words
• Reverse the case of every letter (i.e., 'cAPS lOCK' fix)

    [Reverse the case... is also included as a separate macro in the download ZIP file. See below.]

Download CONVERTCASE.ZIP (v1.04.01; 08/21/2021;
26,704 bytes)

Convert case.wcm was originally written in WordPerfect X5, and recently updated and tested in WPX6-WP2020.

Reverse case.wcm was written in WPX7.

Downloading, Documentation, Modifications, and Support


Note -

WordPerfect menu choices on this page refer to the <WordPerfect> menu (right-click on the top menu bar for a choice of menus). If you use a <Microsoft Word> menu, the choices might be absent from your menu (but not from the program), or they might be found under another menu selection. See here for more.

Related pages and other items -

•  CapFirst -
A macro that converts just the first letter in a sentence to UPPER case if it's not already in upper case, without affecting any other upper case letters in the sentence.

   Similar to the Convert Case macro's "Lower case [except words that begin sentences]" — but it converts only the first letter of the sentence, which might be more useful during some editing tasks.

•  RLCaps - A macro that finds every capital (uppercase) letter, then emphasizes it with redline. It can optionally add large size, bold, and/or italics, Like This. Changes are easily undone.

   This makes capital letters easy to find when proofreading the document. (See the footnote on that page to add a new font to upper case letters.)

•  ConvertV - A macro that converts selected text to Initial Capitals, then replaces any uppercase in the selected block to their lower-case equivalents (e.g., it converts
"V." and "VS." to "v." and "vs." — or "SMITH V JONES" to "Smith v Jones").

   No menu appears to make it very quick and easy to use.

•  Smallcaps2Caps - Convert Small Caps (a text attribute: Format, Font, Small Caps) to ALL CAPS with the small macro in Footnote 3.

Convert case.wcm (v1.04.01)
[same as v1.03.01 but with a newer, simpler menu]

Convert case is one of two macros in the Download ZIP file (◄- left sidebar).
The other macro is a standalone version of Reverse case (see below).

Background, purpose and advantages

WordPerfect X8 and earlier versions have a built-in menu, Edit, Convert Case, to convert the current word or a selection of text to -

•  lower case,
•  Initial Capitals.

WordPerfect X9 (released in May 2018) and later versions include another menu option which converts all selected text to lower case except for the first letter of sentences which letter is converted to upper case:

•  Sentence case.

Some notes about "Sentence case"

¤  What about existing upper case characters INSIDE a sentence?
The WordPerfect feature to produce "Sentence case" will convert any existing intra-sentence upper case characters to lower case.
(This is also true of the Convert Case macro's Sentence case option.) If this is an issue for you, see the CapFirst macro, which converts only the first letter in a sentence to upper case if it's not already in upper case without affecting any other upper case letters in the sentence. (See the examples on that macro's download page.) It can also "step through" the document to process sequential sentences, if desired.]

¤  What if you are using WordPerfect X8 (c. 2016) or earlier?
[For macro writers:] WordPerfect X9 has a new macro command to correspond to this new option: ConvertCaseSentence. While this command is incorporated in v1.03 of the Convert Case.wcm macro it is only operative if your WordPerfect version is X9 or later. It did not exist in earlier versions, so it will not compile in them. To compensate for this, when the macro is played in WordPerfect X8 or earlier version special macro commands are used to produce the same "Sentence case" result. (This is transparent to the user.)

When the macro is played (e.g., with Tools, Macro, Play) it will pop up a small push-button menu [screen shot] to let you convert the word under the cursor, or the word(s) that you have selected, into -

[2]  Initial Capitals for the Main Words ( 'Title or Headline Case')
[3]  Initial Capitals For All The Words
[4]  Initial capitals for first word only ( 'Sentence case' )
[5]  lower case for all the words
[6]  Reverse the case of every letter ( 'cAPS lOCK' fix)

Choices 1, 2, 4, and 5 are the same as on the Edit, Convert Case menu in WordPerfect X9 and later versions, and function the same way.

Choices 3 and 6 are particular to this macro. Choice 6 — reversing the case of all letters in a selection of text — can correct for accidental use of the Caps Lock key (e.g., it changes tHIS to This). [Prevention tip: See "Make the <Shift> key turn <Caps Lock> off automatically" here.]

All six choices can be accessed with fewer keystrokes or mouse clicks than by using the WordPerfect menu. See also "Make it easy to use" below.


¤  Any existing text formatting (bold, Italics, word and line spacing, etc.) applied to the word or selected text is not affected by the macro.

¤  For the first two Initial Capitals... menu choices on the macro's menu, be sure to read "Initial Capitalization in Titles and Headines" below.

¤  The Initial Capitals for the Main Words choice on the WordPerfect menu as well as on the Convert case macro's menu depends for its operation on a special WordPerfect file which contains minor words (e.g., "a") that should be excluded, such as in headlines or titles. This exclusion file is an editable file whose contents differ according to your language version. See Footnote 2 below for more information.

Make it easy to use

Since the macro's menu uses push buttons that can also be operated with keyboard shortcut keys, the macro and its choices can be used entirely from the keyboard by assigning the macro to an available and easy-to-remember keyboard combination (i.e., shortcut) such as <Alt+c>.

Then, for example, when you press <Alt+c> and immediately follow it with the mnemonic letter for the menu item (u,m,a,i,l,r) the macro will dismiss the menu and perform the chosen function on the current word or the selected text. You can also press 'c' for Cancel.

To assign the macro to a shortcut key combination, see https://wptoolbox.com/tips/Assign.html.

You can, of course, use a mouse to make your conversion choice by clicking the appropriate (full width) button on the macro's menu. If you use a mouse, you may prefer to create a button on a toolbar that brings up the macro; see https://wptoolbox.com/tips/CreateTB.html.

If you prefer using menus, it might even be useful to replace the built-in WordPerfect Edit, Convert Case menu selection with a new selection that plays the macro; see https://wptoolbox.com/tips/NewMenu.html for help with doing this.

Notes and tips

☼  Except for the reverse case option this macro leaves the converted text selected so that you can make other changes to that text. Be careful: Starting to type something when text is still selected in Windows will cause the new material to immediately replace the entire selection. (If that happens Ctrl+z should restore things.)

Simply press the arrow key (or click elsewhere) and you can move past the selected text and de-select it at the same time.

If you prefer to have the macro de-select the text automatically, see the
redlined instruction in the macro code, just below the Label(End@) command. [Macros can be opened and edited like any other WordPerfect document. When you have finished editing simply click Save & Compile from the macro toolbar that should be visible (or you can just save the file with File, Save).]

☼  [WordPerfect X8 and earlier versions:] The fifth menu choice, Lower case [all letters in the selected text], might take a few seconds on very large blocks of text. By design, the screen will go blank while it does the conversion to speed things up. [You can always stop any macro by right-clicking on the (cassette) icon in the Windows notification area (a.k.a., system tray).]

☼  You should always review changes to be sure they are what you expect. You can usually undo changes with Edit, Undo or <Ctrl+Z>.

For example, hyphenated words such as "de-select," "natural-born," etc., are considered a single word in WordPerfect; thus the use of the Initial Capitals and Reverse Case options will ignore the second part of such compound words. This might or might not be what you want.

☼  Initial capitalization in titles and headines.

According to the Chicago Manual of Style (CMS) FAQ site (Capitalization,Titles), the rules about titles or "headline-style capitalization" are somewhat flexible. As they stated in an old FAQ:

In regular title capitalization, also known as headline style, the first and last words and all nouns, pronouns, adjectives, verbs, adverbs, and subordinating conjunctions (if, because, as, that, etc.) are capitalized. Articles (a, an, the), coordinating conjunctions (and, but, or, for, nor [so, yet]), and prepositions, regardless of length, are lowercased unless they are the first or last word of the title or subtitle. ...

They conclude that "considerations of meaning and aesthetics can probably be let in". In other words, the rules are sometimes broken, depending on what seems appropriate at the moment. Still, rules should be understood before you break them.

How does this relate to WordPerfect?

WordPerfect stores exceptions to the rules for initial capitalization (i.e., when you use Edit, Convert Case, Initial Capitals) in a normal WP file, WTNNXX.ICR (where NN is your WordPerfect version number and XX is your language version). Words in this file will be NOT be capitalized when the Initial Capitals feature is used.

The WTNNXX.ICR file can be edited as any other WP file to add or delete words (punctuation is ignored) (see Footnote 2). However, it does not contain a comprehensive list of prepositions (see the CMS quote above). In any case, many such words can also be nouns, adverbs, or adjectives. So, bear in mind that if you use WP's Initial Capitals feature with titles or headlines, you may want to inspect the conversion to ensure it meets standard rules such as those embodied in the CMS, or that it meets aesthetic needs [e.g., John Updike’s Rabbit is Rich (lower case "i") makes more sense than Rabbit Is Rich (upper case "I"), even though the rule says the word "is" should be capitalized, and WP will dutifully capitalize it].

On top of this, for some reason there is a large difference in the exception lists for the US/CE language versions of the .ICR file (which contain 70 words) and the UK/OZ versions (13 words). For example, the letter "a" is not in the UK/OZ exception files, and the conjunction "nor" is missing in all four English language lists, which means it will always be capitalized.

WordPerfect is a computer program, after all. Don't expect it to take the place of your own judgment.

☼  Initial Capitals for Main (or All) Words is something that is generally used for titles or headlines (see previous tip) — not for headings. See, for example, Practical Typography - headings here.

[Page top]
    Reverse case.wcm (v1.01)

    [Note: The function of this macro is included in the Convert case.wcm macro above (and is available from its pop up menu), but a separate Reverse case.wcm macro file is also included in the download ZIP archive for those who just need that function.]


    This macro is designed specifically to let you quickly reverse the case of each letter in recently typed text (or any text).

    This can help when the Caps Lock key was left "on" while you were typing and you didn't notice because you weren't looking at the screen at the time.

    If so, pressing the Shift key while typing with Caps Lock on reverses any capital letters, like this example:


    This reverses the case of the letters from what you intended. The macro can correct this error almost instantly, to this:

    "The International Business Machines Corporation (IBM) is an American multinational technology corporation."

    The macro can also be useful to instantly change a lower case word under (or to the left of) the cursor to all CAPITAL letters, or vice versa.


    Just place the cursor on the incorrect word or select the incorrect text (e.g., use Shift+arrow or the mouse), and then play the macro. [Note that no menu is displayed since none is needed. However, with version 1.01 there is a pop up dialog to show a running count of letters processed and also allow you to cancel further operation of the macro (useful if you selected too much text).]

    If nothing is selected the macro will attempt to select the item under, or to the immediate left of, the cursor.

    Notes and tips

    ☼   For quicker access to the macro you can assign it to a shortcut key, toolbar button, or menu choice (see http://wptoolbox.com/tips/EasyPlay.html). For example, if the shortcut key Alt+Z is available for assignment (see http://wptoolbox.com/tips/Assign.html), it might be a good candidate to play the macro since a similar shortcut, Ctrl+Z, is the standard Undo key for many other things in Windows.

    ☼  This macro works only on ordinary alphabetical characters, skipping over any numbers, keyboard symbols, punctuation, and format codes. It also skips WordPerfect symbols from the symbol sets (Insert, Symbol) — including alphabetical "characters" since they are not standard (A-Z, a-z) alpha characters, as can be seen in Reveal Codes.

    ☼  If there are any bookmarks (Tools, Bookmarks) inside the selection of text they might be relocated elsewhere in the selected area. (This is an artifact of using a new paired bookmark to delimit the text to be converted which also contains a bookmark. See the top of the macro code for how this is done.) But this should be fairly rare since the macro was designed to be used soon after incorrectly typing new text — presumably before any bookmarks might be inserted in that text.

    ☼  There are a couple of ways to help prevent the reversed-case problem in the first place:

    (1) Enable the CapsFix checkbox option in Tools, QuickCorrect, Format-As-You-Go

    - and/or -

    (2) allow the Shift key to automatically turn Caps Lock off, as was the method used back in the typewriter days. (This works in all Windows programs, including WordPerfect.) For the method see "Make the <Shift> key turn <Caps Lock> off automatically" at  http://wptoolbox.com/tips/CapsFix.html.

    [Page top]

    Footnote 1

    [This footnote was removed when the Convert Case macro included an option to capitalize the first letter of ALL words in a selection of text (i.e., in v1.02).]

    Footnote 2

    [Continued from above ....]

    ... WordPerfect stores exceptions to the rules for initial capitalization (i.e., when you use WordPerfect's Edit, Convert Case, Initial Capitals) in a normal WP file, WTNNXX.ICR (where NN is your WordPerfect version number and XX is your language version).

    Words in this file will be NOT be capitalized when the Initial Capitals (for Main Words) feature is used.

    The WTNNXX.ICR file can be edited as any other WordPerfect file to add or delete words (punctuation is ignored).

    Here's an easy way to do it:

    Exit from WordPerfect, then -

    (1) Make a copy of your WordPerfect program's .icr file to another folder [on my Windows 10 system (with WordPerfect X9) the original file is in this folder:
    C:\Program Files (x86)\Corel\WordPerfect Office X9\Writing Tools

    (2) Rename the original file (e.g., to WT19us.icr.OLD) to back it up. Note that since the original is a program file you will need administrator rights to rename it.

    (3) Open the copied file in with Windows Explorer's (right-click-on-filename) "Open with...WordPerfect...".

    (4) Modify the copied file while it's open in WordPerfect (it's just a list of words, each on a separate line).

    (5) Save this modified file with the original name (e.g., WT19us.icr).

    (6) Close WordPerfect.

    (7) Move (or copy) the modified file back into the original folder (e.g., C:\Program Files (x86)...etc.). [In Windows Explorer it should appear adjacent to the backed up version.]

    (8) Re-launch WordPerfect.

    These steps might be simplified by changing Windows permissions for the file (via its Properties) — but they work easily enough to revise the file without impacting the original.


    The Convert Case macro (see above) has the option, Initial Capitals For All The Words, which simply uses a small trick to effectively make the .ICR file invisible to the program (while the macro runs). You can view this method in the macro's code.

    An alternative macro to convert text to initial capitals for all words in a selection of text is to use this one-line macro on the selection:

    Type (ToInitialCaps (?SelectedText; FirstOfEachWord!))

    The macro will replace the text selection with the same words — but every word will be capitalized. [Thanks to Brad Robertson at WordPerfect Universe for this tip which he posted here.]


    While this particular one-line Type(...) macro is simple and potentially useful to many users, be aware that it will remove formatting (e.g., bold, italics, etc.) from the selected text. If this is not acceptable, please consider using the Convert Case macro's
    Initial Capitals For All The Words option instead.

    Footnote 3
    [Continued from above...]

    On occasion you might apply the text (font) attribute, Small Caps, to a selection of text -- and later decide it should have been ALL CAPS. When this happens in several places or in several open documents it can be quicker to use a macro to do the job. Here's one to do the job.

    Tip: To copy the code below into your WordPerfect program to create a working macro see here.

    Note: You can remove the 3 lines of Optional code that pauses the macro at each instance found. Be sure to also remove the Label(NextOne@) command, too.

    // Macro code begins here
    // Smallcaps2Caps.wcm - Converts all text with the Small Caps attribute to
    // all capital (UPPER case) letters.
    Display(On!) PosDocTop vCount:=0
    vSmCapsOn=NTOC(65054)  vSmCapsOff=NTOC(65055) // (<= used in SearchString)
        // -----
    Optional code:  Pause for confirmation at each item located:
            Messagebox(vAns;"";"Process this item?"; YesNoCancel!)
            If(vAns=2) Go(Exit@) Endif // (if Cancel)
            If(vAns=7) Go(NextOne@) Endif // (if No)
        // -----
            DeleteCharPrevious  // (delete the paired SmCaps codes)
    MatchSelection  // (restore to default)
    Messagebox(;"Finished!"; vCount+" items were processed.")
    // Macro code ends here

    [Page top]