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-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Feb 2, 2022

WordPerfect Tips
Main tips page | Browse more tips

Styles



More resources about Styles on this site

•  Custom styles - Creating custom styles; Saving custom styles to your default (or other) template; Retrieving custom (user) styles from another document or template; How to remove the new style from the default template

•  Mark a custom style for automatic inclusion in a Table of Contents

•  Replace one style with another, or remove a style's codes

•  Replace a "text attribute" (bold, italics, underline, redline, etc.) with a different attribute (or even a custom style), or just remove the attribute from the text

•  Block protect paragraph styles (e.g., "Heading 2") and following body text

•  Using, creating, and modifying Outline styles

•  Automatic paragraph numbering, outlines, and numbered lists

•  Automatically numbered document headings

•  Adding emphasis to text: How to create custom paragraph/page border or fill styles

•  Miscellaneous tips for inserting and using graphics (a form of style) in a WordPerfect document

•  How to create a Question-and-Answer style

•  Insert identical text in several locations (Note: WordPerfect 10 can do this with its new 'text variables' feature)

•  Alternative heading styles - A "Stepped" style; Legal-number-style headings and other automatically numbered headings; using the Columns feature

Also see the examples in the Tips section, which show how to create custom styles -►





  About text styles ...

  Styles are design elements — such as bold, italic, extra large font,  colored text, margin settings, etc. — that can be applied to text.

As the term is used here — and as WordPerfect's Help module defines them — styles are a collection of formatting attributes. While the program ships with various pre-installed styles (e.g., Heading styles), you can also create your own styles.

Once created (and saved) they can be reused in other documents by simply inserting the style (or selecting some text and applying the style to the selection) by choosing it from the "Select Style" drop list on the text property bar, or by using Format, Styles, Insert on the main menu.

Though text styles are easy to create and use, some "WordPerfectionists" never use styles, preferring to directly control formatting in the text itself, where all format codes are clearly visible in Reveal Codes. [See Footnote 1.]

Still, styles have several advantages as discussed on this page.

  Styles are special format codes that act like containers to hold your custom formatting.

They usually hold several format codes (as above) but they can even hold text (but see Footnote 2), graphical items, tables, watermarks, and even other styles ("nested" styles).

Moreover, the items inside a style code are relatively immune from global operations (such as Find and Replace), casual user editing, or accidental deletion.

Since WordPerfect is a "stream oriented" program, styles take effect until either discontinued, replaced, or removed by another code. You can see (in Reveal Codes) just what is happening with such formatting by looking for various On and Off codes for a particular format to verify where a style begins and ends, or to check problems with overlapping or competing codes.

  Styles are easy to create, edit, or import from other documents.

They are very easy to apply to text in your document and may be suited for a variety of tasks. They can give a consistent look to the document, and they have the big advantage of being globally changed simply by editing any single instance of a particular style in a document.

[N.B.: Such global change requires that a checkbox, "Automatically update style when changed in document," be enabled in the Styles Editor for that style. (See examples below or see the CustomStyle page for more.) Of course, if you share the document with others let them know about this setting or they might be surprised to see global changes when none were expected!]

  Even some things we think of as separate WordPerfect features are basically just special types of style.

Headers, footers, watermarks, footnotes, endnotes, outlines, margins, comments, etc. — all are built-in styles!


  Types of text styles - an overview

There are three general types of WordPerfect text styles (for some tips on inserting and using graphic styles see here):

•  Character — typically these are applied to selected text (i.e., text you first select with mouse or keyboard) and are usually limited to applying a different font or combination of font attributes (bold, underline, color, etc.), or perhaps new page margins or paragraph margin adjustments (or even including such new adjustments).

They generally will override any Paragraph styles (see next item) that might be applied at the current cursor location (see exceptions on the CustomStyles page here).

• 
Paragraph — these affect text up to the point where you press <Enter> (even after a single word, short phrase or sentence). Typically, you use Paragraph styles for headings, titles, outlines, etc., by applying them to selected text.

They generally will override the initial Document style settings (see next item) or other formatting at that location.

Note: Because short text phrases are often used as headings or section titles, WordPerfect comes with several standard Paragraph styles (Heading 1 through Heading 5) available from the drop list on the Text property bar. They are also set up (i.e., internally "marked") to be included in a Table of Contents (if any).

•  Document (a.k.a "Open") — these apply to all text in a document from the cursor location forward until another text style of the same type is encountered (if any). Typically these styles are used to set formatting for the remainder of the document (or to a point where another style replaces or modifies one or more of the Document style's internal elements).

Note:

The initial style at the very top of a document (seen in Reveal Codes as [Open Style: DocumentStyle]) is a Document style. It is inherited from the template that spawned your current document and it sets up initial ("default") formatting for the document.

This particular style can be edited to modify it by double clicking its code in Reveal Codes, as explained here. Similarly, most other styles can be quickly edited in their document text location by double-clicking on their code to modify (customize) them using a Styles Editor, as explained here.

The type of style in effect in a document — Character, Paragraph, or Document — should be visible on the code itself in Reveal Codes. Just hover your mouse cursor over the [Style] code (or place the cursor to the left side of the code) and information about the style should appear.

By default, the program stores new styles only in the current document, but they can be saved to your template for future use, retrieved from other templates or documents, etc. (see Custom Styles).

The program displays available styles in the Format, Styles dialog. There you can create, edit, copy, and delete your styles (optionally retaining their formatting in the document). (See also the section below on how to control what is displayed in that dialog.)

Available styles are also displayed in the Select Style drop list on the Text property bar for quick access.

It's important to note ...

Character and Paragraph styles are paired-code styles.*

A related pair of codes — an "On" code and an "Off" code** — apply the specific style to your selected text. You can see them in Reveal Codes.

By design, if you delete either one of the pair of codes in Reveal Codes*** you will delete both codes at that location and thus delete the style from that document (only).

On the other hand Document styles are produced by a single code that remains in effect until replaced by another style of the same type (if any).

In other words, Document styles do not have an "Off" code as part of their style. You can delete the style at that location in the document (only) by deleting its "On" code in Reveal Codes.**

In all three types of styles, deleting the code that produces them (in Reveal Codes) does not delete the text to which the style was applied unless you manually do that (or use a macro to do it) by selecting the codes and the text. But remember that some styles you create might also contain text — in which case that style's internal text will also be deleted from the document if you delete the style code (in Reveal Codes) that contains it.

----------
*
Paired codes are sometimes called gate codes since they have an "open" (on) and a "closed" (off) state. They define a "zone" of influence for styles that use them.
   As noted above, a chosen Character and Paragraph style is automatically applied to selected text, but you can also [1] insert the style first, then [2] type or paste text between the pair of codes (see them in Reveal Codes), then [3] move the cursor out of the style's zone (with an arrow key or mouse click).

**
"On" and "Off" are merely descriptive terms here; they do not appear as labels on the codes themselves when the codes are viewed in the Reveal Codes pane or when the mouse pointer hovers over them. However, the angled horizontal edges of paired codes points toward the "zone" of influence, which helps differentiate between them.

***
Deleting a code from Reveal Codes usually can be done by dragging the code from the Reveal Codes pane with your mouse, or by placing the red block cursor () in Reveal Codes to either the left or right side of the code and pressing either Delete or Backspace. (Not all codes can be deleted this way — such as the [Open Style: DocumentStyle] code mentioned above.)


  Tips and examples
  Tips

  Steps to CREATE a style [see also the Examples below]

■  Recommended for newcomers (includes step-by-step detail, images, etc.):

Custom styles
Creating custom styles; Saving custom styles to your default (or other) template; Retrieving custom (user) styles from another document or template; How to remove the new style from the default template.

■  Recommended for users who know how to do it but might not remember the general method:

•  Click Format, Styles. 

•  Click Create to bring up the Styles Editor.

•  In the Styles Editor, type a name for the style in the Style name box (12 characters maximum).

Give each style a unique name to prevent replacing existing styles in a combined document that have the same name. 

•  Type a description for the style in the Description box.

•  Choose a style from the Type list box. [N.B.: See Types of Styles above.]

•  Specify the formatting:

Using the Styles Editor's toolbar, apply any style attributes such as Bold, Italics, etc.

You can also use the Editor dialog's menu for things like setting tabs, page margins, etc.

•  If you want to define what function the Enter key performs when the style is applied, in the "Enter key inserts style" list box choose -

(A) another available style, if desired;

-or-

(B) <Same Style> if you wish to "chain" the style used (N.B.: this generally applies to Paragraph styles; further, you can "escape" from the style with the RightArrow key to move past the [Style] code);

-or-

(C) <None> (the default), so that pressing Enter returns to the style that existed before the new style was inserted (N.B.: this will be the [Open Style: DocumentStyle] set at the very top of the document if no other style precedes it).

•  If you want to display the codes that take effect when a style ends, enable the Show ‘off codes’ check box. 

•  Click OK twice to return to the document. 

•  Note that the new style will also appear in the Select Style list on the text property bar as well as in Format, Styles.
  See also "Creating or modifying outline styles." (WordPerfect outlines are a form of Paragraph style.)

  You can also create a style quickly by using QuickStyle. See WordPerfect's online Help [the <F1> key] or click here.

  For temporary work — i.e., copy the format of text and apply it elsewhere in the document — you can use QuickFormat. See WordPerfect's online Help [the <F1> key] or click here.

  You can quickly edit — i.e., CHANGE — an existing style in the current document by double-clicking the [Style] code in Reveal Codes. The Styles Editor that appears has a menu and toolbar which you can use to add format codes to the Contents pane in the Styles Editor. The changes made this way will be stored in the current document. (The information here on creating a custom style should help you with editing a style, saving it as a custom style, etc.)

Important tips and a caution about editing (or creating) styles within other styles from Noal Mellott from a post on WordPerfect Universe:

"[WordPerfect] styles accept many codes, but some of the more complex codes (table, header, footer, graphic or an open style) cannot be created or edited inside the style itself. They can only be created or edited in the ordinary document screen, whence you can cut and paste them into a style.

Some codes encapsulated in a style (via the Styles Editor) cannot be modified once there (WP runs a message telling you so [or the program might simply freeze]). In these cases copy such a code back into the document, modify it there and then re-copy it back into the style.

For example, you might have trouble editing a header and delay/discontinue codes related to it inside a style. If so, cut [Ctrl+x] the codes out of the style and pasting them [Ctrl+v] in the ordinary document screen. Edit them there and then paste them back into the style."

[Also: If you wish to create (cf. edit) a delay in the appearance of some feature — such as a new header or footer — that will work automatically in all new documents, you should set up the delay, etc., in a separate, new blank document and test it there. Then carefully copy the [Delay] code (which is a form of style) back into the Contents pane of the initial style code, using one of the methods described here. You should do it this way because trying to create some styles within another style — "nested" styles — can cause the program to freeze. (This problematic issue of creating nested styles was described in the same WordPerfect Universe thread as Noal's post above (e.g, see here.)]

  Change the formatting of just a portion of the style's text: If you have applied a Character or Paragraph style to some text (which, as noted in the previous section, are paired-code styles) and "Automatically update style when changed in document" is enabled in the Styles Editor for that style, you can change the formatting of a portion of the text to which the style was applied by selecting that portion of text first, then apply the formatting (e.g., italics).

[Note the emphasis on portion: If instead you select all the text to which the style was applied — or apply the formatting first with a toolbar button or shortcut key (e.g., by using Ctrl+I) — this will tell WordPerfect to apply it to the entire style's text by adding the new formatting code inside the [Style] code. (You can always edit the style code to remove this formatting. See the previous tip.)]

  Insert blank lines or additional text text inside a style's text:  Position your cursor in the body text to which a style (including an outline style) has been applied, and then insert a line break with <Ctrl+Shift+L>. This inserts a [Ln Brk] code in Reveal Codes. Line breaks also preserve any previous paragraph indentation (Format, Paragraph, Indent).

  "Close up" the space between a Heading (or other paragraph) style and the following paragraph:  Assuming you add a hard return (<Enter> key) immediately following a Heading paragraph style, you will get a full-height space between the Heading and the next paragraph. You can shrink it by editing the existing Style (see above) in several ways.

•  You can shrink the space by editing the existing Style (see above tips) and adding a Line Spacing code ([Ln Spacing]) in the style's Contents pane, in front of [to the left of] the existing codes there.

Just use the Editor's Format, Line, Spacing menu choice to reduce the line spacing for just that paragraph style.

Example screen shot here using 0.5 spacing in Heading 2.

You might want to experiment with different settings. This change will apply to just the text to which the paragraph style is applied and just in the current document. Following the style, the line spacing will return to whatever it was before that style was applied (usually, 1.0).

[See here for more on creating a custom style, editing the style, and saving it a custom style, etc.]

•  Alternative (from a method posted on WordPerfect Universe) using an Advance code:)

"Spacing Before and After" with a Heading style

[1] Either create a new paragraph heading style with Format, Styles, Create (see above) -or- edit your existing paragraph style with Format, Styles, <stylename>, Edit (see also a tip above).

Either way, be sure to set "Enter key... <None>" and choose Paragraph as the Type.

[2] At the bottom of the Styles Editor dialog window, be sure to check (i.e., enable) the box, "Show off codes."

[3] In the Contents window of the Styles Editor, place the cursor before [to the left of] all codes. Then, on the Styles Editor menu, click on Format, Typesetting, Advance to bring up the Advance dialog. Click the "Down from insertion point" radio button and set the Vertical distance to (for example) 0.15". Click OK.

This adds a bit of extra spacing above the Heading style's text.

[4] Position the cursor in the Contents window after [to the right of] all codes — especially after the "Codes to the left are ON, codes to the right are OFF" code. Click on Format, Typesetting, Advance to bring up the Advance dialog. Click the "Up from insertion point" radio button and set the Vertical distance to (e.g.) 0.15".

In this example this restores the setting you made in step #3 by shrinking
the spacing below the Heading style's text an equal amount.

[5] Click OK twice to return to the document.
...
Note: Normally, 12-point text gives 6 lines per inch, or 0.167" between lines. The above method adjusts the inter-paragraph space to 0.017" (0.167-0.150). This setting assumes you will have a hard return (i.e., a blank line) between the headings and the following paragraphs, so it adjusts the amount of inter-paragraph blank space by reducing it. Be sure to adjust the vertical down/up amounts [steps 3 and 4] to match your particular needs.

Related tip:


You can also use this basic method to either expand the space before the paragraph Heading style or shrink the space after the Heading style. Or, as above shown, you can do both in the same style
simultaneously.

•  For some other things you can do with paragraph styles:
See "Need a different look in your document's headings".
See also this macro: Block protects paragraph styles.

  End ("break out of") a previously applied style mid-way in the style's text: Position your cursor where you want the current style to end and press <Shift+Enter>. This is a fast way to "end" a style. Note that if the cursor is at the end of the style's text — but still in the style's format "zone" — it will simply move outside that style's zone. [Thanks to Noal Mellott at WordPerfect Universe for this tip.]

  Convert a custom style into normal formatting codes: If you click Format, Style, then select a custom style, then click Options, Delete ... you can choose to "Leave formatting codes in document." This is an easy way to convert a custom style into normal formatting codes. (You can't do this with standard "shipping" styles.) N.B.: If you have duplicate style names in the list, you should delete the style stored in the current document, not the template. (The location — current document or template — of each style is shown on the right side of the Styles dialog.)

Here's a three-line macro that will do the job. Be sure to change "MyCustomStyle" below to the name of your actual custom style (but retain the quote marks). Note that the code redirects the macro to a Label() if the style does not exist. (To copy macro code here into WordPerfect, see CopyCode.html.)

OnError(End@)

StyleDelete (Style: "MyCustomStyle"; Codes: LeavingCodes!; Library: CurrentDoc!)


Label(End@)

  Save them for future use: By default, customized styles are saved with the current document, but you can also save them to your default template or other template so that they will available for all new documents based on those templates. You can also copy styles from one document to another. See the Custom Styles page here.

  Adjust what displays in the Styles dialog's Available styles list (and also in the Select Styles drop list on the Text property bar), and/or where to save new styles. (Session-specific settings.)

To do this, click Format, Styles, Options button, Settings.

The Style Settings dialog appears.

Note: Any changes you make to this dialog's settings are operational only for the current WordPerfect session. They are reset to their defaults when you next load WordPerfect. [To manually save specific custom styles to your default (or other) template later, see the CustomStyles page here.]

Style Settings dialog

Left side of dialog:

The first three check boxes on the left side of that dialog are enabled (ticked) by default.

Styles in current document: displays the styles for features, such as footnotes, hypertext, and tables of contents, that are in the active document. [Tip: Sometimes unused custom styles that might be stored in a document are not needed any more. They can be easily removed from that document (and thus not displayed in the styles list) using Corel's free WPLOOK repair utility, described here.]

Styles in default template: displays styles found in the default template file.

WordPerfect system styles: displays all styles for features, such as headings, footnotes, hypertext, and tables of contents.

The fourth check box, Styles from additional objects template, is disabled (un-ticked) by default. You can enable it to display styles in an additional objects template if you use one.

The two radio buttons below the first three check boxes let you display just WordPerfect heading styles or display all styles (i.e., heading styles and all other system styles such as headers/footers and comments).

Most users will typically use the first radio button setting, unless there is a reason to display every style on your system.

These checkboxes and radio buttons control what appears (displays) in the available styles list.

Right side of dialog:

The three radio buttons on the right side of the dialog let you customize where WordPerfect should automatically save (i.e., store) newly created styles — i.e., in the current document, or the default template, or the Additional Objects template (if used).

The default choice is "Current document," which is the typical choice for most users.
This is because they don't want every new style created during the current session to be automatically saved in their default template.

However ... you can always save any custom style to your default template (or to a custom template) later, using the method here.


  Other references:

•  Some older manuals that might still be available:

A good, basic introduction to styles can be found in Laura Acklen's Absolute Beginner's Guide to WordPerfect 12 (or other version), which is inexpensive. Check Amazon.com or other bookseller.

A more comprehensive guide is Laura Acklen and Read Gilgen's Special Edition: Using WordPerfect 12 (or other version).

[Both books are published by QUE.]

•  A good peer-supported (free) website to join: WordPerfect Universe (http://wpuniverse.com/vb)
  Examples
Example 1 - Create a custom style to automatically convert selected text to UPPER case

(See also Footnote 3)

To give you an idea of how easy it is to create a custom style, let's suppose you want to create a style that turns all selected text into UPPER CASE (a.k.a capital letters) because WordPerfect has no direct way to do this except by selecting some text and clicking Edit, Convert Case. UPPERCASE.

You simply create a style that uses both Small Caps and Large size. Then you can apply this custom style to text that is all lower case. This should give you something similar to all upper case for most fonts and typical sizes.

•  Click Format, Styles, Create.

•  In the "Style name:" field, give the style a name.

•  Add a description if desired in the next field.

•  In the "Enter key inserts style:" field, select <None>.

Note: This field lets you choose another style to become active when the Enter key is pressed; here, you most likely want normal body text to become active, so <None> will default to your body text style. If you select <Same Style>, WordPerfect will continue applying the same style to the next paragraphs — that is, the text following a press of the Enter key — until you deliberately choose another style from the Select Style list on the Text property bar (or from Format, Styles).

•  In the "Type:" field, select Paragraph for headings and other single paragraph types of text, or select Character if you want to apply the style to a word or a few phrases (then, after applying the style, press the right arrow key to skip past the "ending" style code and resume typing normal text). If you select Document (open), the style will be used until you deliberately select another style or choose until you choose <None> from the Select Style list.

•  In WordPerfect 9 and later, check the box, "Automatically update style..." if you want all instances of the style in the document to change if you change any single instance of the style's formatting. (Most people probably want this to happen.) In WordPerfect 8 and earlier, you will not see this checkbox; rather, use the "paired-auto" version of the style in the Type field.

•  Put the cursor in the "Contents:" field (or "pane"). This is where the actual style's formatting codes (and any text characters) are stored. (See also "Tricking WordPerfect" in the next example below.)

From the Styles Editor's menu at the top of the dialog, click Format, Font, and check the Small caps box; then click the Relative size button and choose Large. This inserts two format codes in the Contents field.

Note the "Show 'off codes'" checkbox: If you enable it you will see a long, "text placeholder" code appear:

   
[Codes to the left are ON - Codes to the right are OFF]

This code can be selected (it's easier to use <Shift> plus an arrow key) and a paired format code applied to the code itself, such as relative size codes, bold or italic codes, etc. This tells WordPerfect to apply the format to everything in the paragraph, then discontinue it (turn it off) immediately following the end of the paragraph. [For a good example of this, see "Mark a custom style for inclusion in a Table of Contents.] You can also add some codes before and after this long code without selecting it first, to turn certain formatting on and then change it back (e.g., change from one line spacing back to another spacing).

If you are creating a Character style (see above), you don't need to select this special [Codes to the left...] code. Just use the Editor's menu or toolbar to add the format code(s) to the left of the [Codes to the left...] code (assuming it is visible in the Contents pane).

You can add text characters, such as a colon (:), following (to the right of) the [Codes to the left...] code. This will add the colon automatically to any body text to which you have applied the style.

•  Click OK twice to return to the document. The new style will appear in the Select Style list on the text property bar.

•  Apply the new style to some selected text. It you created a Paragraph style, the style will stop with the next paragraph. If you created a Character style, you can insert the style and then start typing in lower case (when finished, press the right arrow key once to skip past the style code), or type the text, select it, and then apply the Character style. You can re-edit the style by double clicking its [Style] code in Reveal Codes.

Advantages

The main virtue of this example — and all Paragraph and Character styles — is that if you enabled "Automatically update style..." you can change any one instance of the style's formatting and all instances will change in the current document.

This makes it very easy to instantly "tweak" the style's text throughout a long document.

[Tip: If you share the document with other WordPerfect users, be sure to tell them about this feature so they won't be surprised when they change one item only to find all similar ones change, too.]


Related tips

In Reveal Codes, you can double-click the style code to edit the style.

You can add this custom style to your default template or any other document. See here for more on saving, importing, or removing custom styles.
Example 2 - "Tricking WordPerfect" (or, "How to work around some limitations")

Example 2(a):

Some things cannot be inserted directly in the Styles Editor's Contents pane from the Styles Editor's menu or toolbar. However, you can create them in the document itself and then copy them from the document into the Contents pane.

    For example, if you want to delay margin settings (or other formatting) to the second and subsequent pages, you can use a [Delay] code on the first page, then copy that code into the initial Document Style, where it will be hidden from view and less likely to be accidentally deleted. See here for instructions.

Example 2(b):

Some custom style formats are difficult to create just by using WordPerfect's QuickStyle (Format, Styles, QuickStyle).

    For example, setting up a custom paragraph style (see basic steps in the preceding section) that makes all text in the paragraph (or selected paragraphs) relatively smaller (or larger) will probably require you to edit the custom paragraph style (Format, Styles, <style name>, Edit) and add the paired codes for relative size around the built-in single "placeholder" code you will see when you enable the box "Show 'off codes'" in the Styles Editor. (This single code shows up as "Codes to the left are ON - Codes to the right are OFF" in the Styles Editor's Contents field.)

    In this example, you would select this single "Codes to the left ..." code (with <Shift+right arrow>) in the Contents field and then click Format, Font, Relative size, and choose a relative size to apply. The "Codes to the left..." code will then be bracketed by the paired relative size codes — which in effect means that the paragraph (or selected paragraphs) will be sized smaller (or larger) when the style is applied to paragraphs.

    For another example of this technique, see Mark a custom style for automatic inclusion in a Table of Contents, which brackets this code with paired Table of Contents codes.

    Note that you can select and bracket the "Codes to the left ..." code with any paired formatting codes using the Styles Editor's own Format menu, such as italics or a new font. You can also add an Indent or Tab code at the beginning of the string of codes.
Example 3 - Create a style using a macro (Advanced users)

Here is a Character style (i.e., one that applies formatting from the current cursor location onward) that a user requested on WordPerfect Universe. It can be used to deploy a custom style on multiple machines, or just apply a custom style when needed by assigning it to a toolbar, menu, or keystroke. (To copy macro code here into WordPerfect, see CopyCode.html.)

Notes and tips

Since WordPerfect 9 was released, you cannot record a style, you have to code it manually.

The macro code below creates a style — named here "SampleStyle" — that applies Arial Black 10-point font, underlining, and red coloring to all text following the cursor location. It also creates the style in the current document only. You will want to change these parameters in your own macro. The items to change are indicated in dark red.

If you want the user to see what's going on in the document, you can force Reveal Codes "on" by using the RevealCodes(On!) command just above the rest of the commands below.

Macro writers can insert a style into a document's (or template's) initial style with a macro. See here for an example.

All commands should be on their own lines without line breaks.

// Macro begins

StyleCreate (Name: "SampleStyle"; Type: AutoCharacterStyle!; Library: CurrentDoc!)

StyleEditBegin (Style: "
SampleStyle"; Library: CurrentDoc!)

StyleDescription (Description: "
Sample character style")

StyleCodes (State: WithOffCodes!; Library:
CurrentDoc!)

StyleEnterKeySetting (Action: StyleOff!)

Font ("
Arial Black Regular")

FontSize (
10p)

AttributeAppearanceToggle (Attrib: Underline!)

TextColor (Red: 255; Green: 0; Blue: 0)

SubstructureExit ()

StyleEditEnd (State: Save!)

// If you want to immediately apply the style (otherwise delete the next line):

StyleOn ("
SampleStyle")


[Footnote section]

Footnote 1

One of the big advantages of WordPerfect compared to Microsoft Word is that you don't need [custom] styles in WordPerfect. As Seth Katz said in a post on WordPerfect Universe:

"... It's fine to depend on styles when you yourself created them and know their details. Another person may not, and that person will either have to spend time excavating the document to determine the formatting of each style, or will give up and use direct formatting. If you're a mechanic you could rearrange all the controls and instruments in a car and on the dashboard to make them more efficient; don't expect anyone else to be able to get in and just start driving. Since WordPerfect [unlike Microsoft Word] doesn't depend on styles you can just apply the formatting [in WordPerfect, these are controlled by in-line codes] as the program is designed to do out of the box, and the next person will do the same. ..."

Some Microsoft Word users might say that WordPerfect codes are a drawback, that they proliferate in a document in a confusing manner. Seth continues:

"The proliferation of codes in WordPerfect is a *FEATURE*, not a bug. Each code is discrete, controlling just one aspect of formatting. Word ... aggregates its formatting because it's part of the object. You can't copy, move or delete just one part of the formatting; it's all or nothing. These discrete codes are why you can search for formatting *CHANGES* in WordPerfect [e.g., with Find and Replace], unlike Word. ...

Actually codes in WordPerfect really don't proliferate, because they don't have to. The stream-based architecture means one code controls that format aspect for all downstream text until superseded by another code [of the same family type]. Contrast that with Word, where every character, paragraph and section contains formatting.

The flush-right discussion [about how to create a small bit of text that is flush with the right margin, or mixing text justification on the same line] points out many of Word's shortcomings. Yes, you can do flush-right in Word, but that's not the point. If you had to you could type your document on a typewriter. The point is how easy, fast and convenient it is to do it. In Word, you have to customize to do it by either manually setting a tab stop or including that tab setting in a style. Later, you will not easily be able to tell which method was used. If you include it in a style, you get all the other formatting included in the style, whether you want that or not. You do not know whether it's available unless you look at the ruler or know ahead of time that it's there. If for some reason you don't want it, you have to change the tab setting or revise the style. If you revise the style, that revision takes effect for every other paragraph formatted with that style, whether you want that or not. And it's available only for that particular paragraph or when using that particular style.

One last thing: If reveal codes is so bad, why has Microsoft done everything it can to emulate it?"

Footnote 2

Starting with WordPerfect 10, Corel included Text Variables (Insert, Variable), a form of WordPerfect style that lets you place the same text in multiple document locations. 

Note that you can include text inside any style code by editing the style and including text characters along with the style's other format codes. But Text Variables can be more convenient, especially with larger blocks of text.

Caution:

In either case, if you want to convert documents that contain such complex styles to Microsoft Word, you should be aware that, since Word has no comparable feature, the text in the style will be lost after the conversion to Word. Similarly, tabs (but apparently not tab settings) inside WordPerfect styles might be lost, too.

Further, it has been reported that including text inside a Style can prevent the document from being opened in ("ported to") Microsoft Word, so it's probably best to use such styles only in WordPerfect documents that are meant for other WordPerfect users -- or for other uses, such as simply printing the document or publishing it to PDF.

Footnote 3

You can, of course, convert selected text's case with a macro.

For example, here's a macro that will convert the current sentence to all UPPER-case. (To convert just the current word, replace the parameter in the SelectOn command with WordMode!. You can also add other commands immediately after the ConvertCaseUppercase command, such as AttributeRelativeSizeToggle (Size:Small!).)

The first segment of the macro takes into account the possibility that something greater than a sentence might already be selected, such as the current paragraph. In that case, the macro will position the cursor at the beginning of the selected text before processing the text.

To copy macro code here into WordPerfect, see CopyCode.html.

// Convert the current sentence to upper case.wcm

// To convert just the current word, replace the parameter in
// the SelectOn() command with WordMode!

OnError(End@)
If(?BlockActive)
  PosSelectTop
  SelectOff
Endif

SelectOn (SentenceMode!)
PosSelectBottom
ConvertCaseUppercase
SelectOff
Label(End@)

And here's a macro that converts the currently selectred sentence to all lower-case, taking into account the possibility that the first letter of the sentence bight be automatically capitalized by WordPerfect's QuickCorrect Format-As-You-Go feature. Moreover, it takes into account the possibility that (1) something greater than a sentence might already be selected, such as the current paragraph; and (2) the sentence begins with a format code or non-alpha (i.e., not an A-Z or a-z) character. (To copy macro code here into WordPerfect, see CopyCode.html.)

// Convert the current sentence to lower case.wcm

OnError(End@)

// Position the cursor at the top of the selection -
If(?BlockActive)
  PosSelectTop
Else
  SelectOn (SentenceMode!)
  PosSelectTop
Endif
SelectOff

// Move past codes and non-letters until an upper or
// lower alpha text character is reached -
While (?RightCode>0 or
  ((not(CtoN(?RightChar)>64 and CtoN(?RightChar)<91)) and
  (not(CtoN(?RightChar)>96 and CtoN(?RightChar)<123))))
  PosCharNext
EndWhile

// Convert the first alpha character to lower-case -
SelectCharNext
vSel:=ToLower(?SelectedText)
Type(vSel)
PosCharPrevious

// Convert the rest of the sentence -
SelectOn (SentenceMode!)
ConvertCaseLowercase ()
SelectOff
Label(End@)

You could add code immediately after the ConvertCaseLowercase command to change the selected text to all caps, etc. See the ConvertCase and AttributeAppearanceToggle commands.


©
Toolbox for WordPerfect - https://wptoolbox.com