|
Custom styles -
If you simply need to transfer
styles to another computer using the same version of WordPerfect,
or reinstall them on the same computer (and same WordPerfect
version), see this
thread on WordPerfect Universe.
Related "styles"
pages on this site:
Styles
Mark a
custom style for automatic inclusion in a Table of Contents
Replace
one style with another, or remove a style's codes
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
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 |
Creating
custom text styles
|
[Much of this section is derived
from WordPerfect 9's Help module.]
For more information about styles,
with several tips, examples, and links to related pages on this
site, see http://wptoolbox.com/tips/Styles.html.
Also see your own WordPerfect's Help (<F1> key). If you
think styles are a useful feature, you might consider picking
up a good aftermarket book on WordPerfect, such as QUE's "Special
Edition - Using WordPerfect Office X3" by Laura Acklen
and Read Gilgen.
Working with custom text styles:
You can create and use your own
text styles. WordPerfect ships with many styles, including five
paragraph heading styles (Heading 1 through Heading 5) that
you can quickly access from the Styles drop list on the text
property bar. (The text property bar diplays when your cursor
is in the body text area of the document. If it does not -- perhaps
because you clicked View, Hide Bars -- click View, Toolbars and
enable the "Property Bar" checkbox.)
Simply put, text styles are collections
of formatting attributes that you can apply to selected text,
paragraphs, or the entire document. They are like little containers
of format codes that enable you to apply all custom formatting
at once, either to the current selection of text, or to the entire
document from the cursor location onward (until the style is
discontinued or replaced by another style).
You can retrieve, copy, edit,
and rename a text style, which is useful if you want to create
a new style based on the formatting options of an existing style.
You can restore a preset system style, and you can delete any
of your user-defined [i.e., custom] styles. You can also save
styles for the current document or for a specific template.
There are three general types
of WordPerfect text styles:
- Character -- generally these are applies 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 attibutes (bold, underline, color, etc.). They will override
any Paragraph styles that might be applied at the current cursor
location.
- Paragraph -- these affect entire paragraphs (up
to the point where you press <Enter>); typically, you use
them for headings, titles, outlines, etc. They will override
the DocumentStyle settings or other formatting.
- 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 ("marked")
to be included in a Table of Contents.
- Document (a/k/a/ "Open") -- applies
to all text in a document from the cursor location forward until
another style is encountered (if any).
- The initial style at
the very top of a document ([Open Style: DocumentStyle])
is a Document style; it sets up initial formatting for the document,
and this style can be edited by double clicking its code in Reveal
Codes.
|
Note
You can also use QuickStyles
(see below) to apply a style. QuickStyles are styles created
based on the formatting in effect at the current cursor location.
Note that the variety of style
in effect in a document -- Character, Paragraph, or Document
-- should be visible on the code itself in Reveal Codes. Just
pass your cursor over the code.
It is also important to note
that the first two style types -- Character and Paragraph --
are paired-code styles. If you delete one of the pair,
you will delete both codes. However, Document styles are produced
by a single
code that remains in
effect until replaced by another style. |
Formatting your text with styles
ensures consistent formatting throughout a document. Whenever
you change the formatting in a style, you change the appearance
of all text that uses that style.
To create a text style (from
scratch):
1. Click Format, Styles.
2. Click the Create button. This brings up the Styles Editor.
3. Type a name for the style in the Style Name box. Give each
style a unique name. If you combine documents that contain a
style with the same name, one style is used and the other deleted
in the new document.
4. Type a description for the style in the Description box.
5. Choose a style type from the Type list box.
6. Using the Styles Editor toolbar and Menu Bar, click the style
attributes you want to apply.
7. Do any of the following:
- Choose an option from the Enter
Key Inserts Style list box to define what the ENTER key does
when the style is applied.
- Enable the Show 'Off Codes'
check box to display the codes that take effect when a style
ends. The Reveal Codes check
box is enabled by default and displays the codes for the style
attributes in the Contents box.
- With the cursor inside the Contents
pane of the Styles Editor, you can not only insert format codes
from the Styles Editor menu or toolbar, you can also type text
characters that will become part of the style.
- TIPS:
- You can also select codes
or text in the body text area of a document and copy them to
the clipboard (<Ctrl+C>) or cut them to the clipboard (<Ctrl+X>).
Then paste them (<Ctrl+V>) into the Contents pane of the
Styles Editor. This is most easily done in the Reveal Codes window
by using <Shift+arrow> to carefully select just the desired
codes and/or text.
- Note: This is one way to deal
with those circumstances where inserting some codes (such as
[Delay] codes) into a style cannot be done from the Styles Editor's
own menu or toolbar. It is explained in more detail in the article,
"Automating WordPerfect
Templates" (see page 3ff, "Formatting custom
templates," and the tips in that section).
- When you create a style you
can enable the option in the Styles Editor to have WordPerfect
automatically update the style when you change any instance
of the applied style. For example, you could select the text
to which the style was applied and add a blue color to it. All
other text in the document to which that style was applied will
immediately turn blue.
- Note: If you share such a document
with other WordPerfect users, be sure to let them know about
this feature so they are not surprised or mystified when they
apply or change some formatting in text to which such a style
has been applied.
To create a "QuickStyle":
QuickStyles are styles created
based on the formatting in effect at the current cursor location.
1. Click in or select the text
that is in the format you want.
2. Click Format, Styles.
3. Click the QuickStyle button.
4. Type a name for the style in the Style Name box.
5. Type a description for the style in the Description box.
6. Enable one of the following buttons:
- Paragraph With Automatic Update
-- applies the style to the paragraph in which the cursor is
positioned
- Character With Automatic Update
-- applies the style to selected text or to text you are about
to type
7. Click Close.
You can apply the style to selected
text by choosing it from the "Select Style" drop list
on the text property bar, or by clicking Format, Styles, <style
name>, Insert. |
Page
Top
Saving
custom styles to your default (or other) template
|
When you create a style (or edit
an existing style) it is automatically saved in the current document.
If you want it available in future documents, you need to save
the custom style to the default template.
Step 1. Open the document that contains the custom style.
Click Format, Styles to bring up the Styles editor.
Step 2. Select (i.e., click on) the custom style in the
"Available styles" list, then click the Options button,
then Copy.
Step 3. In the pop-up "Styles Copy" dialog
that appears, choose "Default template," then click
OK. The style will now be available in all new documents based
on the default template from that point forward.
If you want to copy the style
to a existing template other than the default template
so that the style is available in new documents based on that
specific template:
Step 1. Copy the style to the default template as described
above. Then click File, New from Project (or File, New in WP8)
and select the template to which you want to add the new style.
Basically you want to open this "target" template and
copy the styles into it from the "source" template
(the default WP template).
Step 2. Click the Options button, then "Edit WP
Template." When the template appears, use the Copy/Remove
Object button on the Template property bar to bring up the dialog
that lets you select the Template to copy from (e.g., WP12US.WPT
for WP12's default US template), the Object type ("Styles"),
and the custom styles to copy (in the left-hand field). Click
Copy>> to add the style(s) to the currently edited template.
Step 3. Click Close twice, then "Yes" to save
changes, to return to the main editing screen.
Note: An alternative to this method is to
copy custom styles to a disk file, then import them into the
template. See the next section, under
"Traditional method.)
|
Page
Top
Retrieving custom ("user") styles
from another document or template
|
Need one or more user-created
styles (a/k/a/ "custom" styles) from an earlier version
of WordPerfect?
Want to use one from an existing
document -- even if you didn't create it?
There are several ways to obtain
custom styles (including outline styles and graphics
styles) without having to recreate them from scratch.
TIPS
- After retrieving custom styles
into a document with one of the methods below, you can replace
existing styles in that document with the new styles, using a
macro such as REPLSTY.
- You can remove unused styles
by name from a document or template. See below.
|
Traditional
methods
Saving and retrieving a custom
style in the Styles dialog
The traditional approach is to
first save the custom (user) styles to a special file on disk,
then retrieve it later. This is useful if you don't have the
original document file or WordPerfect template available later
to make a copy of the user-created custom styles.
Step 1.
To save the user styles, open
the document (or template) that contains the desired styles.
Click on Format, Styles, Options button, Save As. Click on the
"User styles" radio button (this saves all user-created
styles) and type in a filename. It's probably a good idea to
give the filename a recognizable extension such as ".STY".
The style file is saved to the default
template folder as shown in Tools, Settings, Files, Template.
Similarly, export any custom
Graphics styles (Format, Graphic Styles, Options, Save
As), if changed or added to, and any custom Outline styles
(Insert, Outlines/Bullets & Numbering, Options, Save As,
User Styles).
Step 2.
To retrieve the user styles,
open the "target" document or template for editing
and click on Format, Styles, Options button, Retrieve, and specify
the name of the saved style file. Click on the "User styles"
radio button.
Note: In the Style type area,
the options are: "Both" - this retrieves both the styles
you have created and the preset styles provided with WordPerfect;
"User styles" (this is the one you want here) - retrieves
only the styles you or other persons have created; "System
styles" - retrieves only the preset styles provided with
WordPerfect. Also, when you retrieve a file the styles in that
file are saved with the active (current) document. To save them
in the default template, see Step 3.
Click OK. The custom styles in
the original source document should show up in the Styles dialog
"Available styles" list.
Remember to retrieve any custom
Graphics or Outline styles you exported in Step 1.
Step 3.
While still in the new document,
you can copy any new style to your default template with Format,
Styles, <choose the new style from the "Available styles"
list>. Click the Options button, then click Copy, Default
template, OK, Close. Repeat for other custom styles you want
to add to the template.
TIP: As an alternative to Step 3, you can
retrieve the styles directly into the default template by first
clicking Format, Styles, Options, Settings; click the option
to save to the default template; then do Step 2 to retrieve the
style file. However, the above three steps may be less problematic
and have the advantage of letting you select the particular styles
to copy to the default template.
TIP: If you have customized Graphic styles
or Outline styles, you can perform a similar save/retrieve operation
with them, too. For more on preserving customizations when upgrading
or reinstalling, see this
thread on WordPerfect universe.
Import custom styles from
one template into another template
Advanced tip:
This method requires you to edit
a custom template to retrieve styles from the original template.
How to do it:
You can import other "objects"
-- customized keyboards, toolbars, menus, styles, etc. -- from
another template (if they are not already present in the new
template) with the Copy/Remove Object button on the template
property bar.
Simply click the Copy/Remove
button, choose the Template to copy from, choose the Object type
(i.e., Styles), select one or more styles, and click Copy to
import them. Click Close when finished, then Save the template.
- Save and back up the new
custom template before importing other objects. This is especially important if you have
spent a lot of time customizing the new template before importing
other objects into it.
- The template to be copied from
must be in the same folder on your system where the custom template
is located.
- Some Styles available in the
old template can be either normal format styles or outline styles.
WordPerfect doesn't tell you which type of style they are in
the Copy/Remove Template Objects dialog's Styles list, but when
you copy them to the new template they will show up in the new
template in the appropriate place (either the Format, Styles
menu, or the Insert, Outline... menu, respectively).
Non-traditional methods
Using a small macro to retrieve
user (i.e., custom) styles:
Example #1: Retrieve
several custom (user) styles with a macro
|
Unlike the traditional method
above, this method is useful if you have the original document
file or WordPerfect template available that contains the custom
styles you need.
Create a macro (see Footnote
1); be sure to change the drive, path and filename
to the template/document that contains the user styles you want
to import. (Retain the double quote marks.)
[Note that the macro below should
be all on one line:]
StyleRetrieve("<drive-path-filename>";
UserStyles!; CurrentDoc!)
You can edit a template and play
the macro so that the new styles will be present in any newly
created document that is based on that (revised) template.
If you need to use the macro
frequently, you can assign it to a menu, toolbar button, or keystroke
combination. See here. |
Example
#2: Retrieve several custom (user) styles from a
macro
|
For intermediate/advanced
users: You can create a macro as a "container"
and insert several styles from it into any open document
or template. (The method can retrieve outlines, too; see Notes
below.) This might be useful for distributing custom styles to
many users in an organization, or to update an existing (and
currently open) document or template on your own system. Just
open the document or template and play the macro to import the
styles. [Thanks to Noal Mellott for this tip and technique, posted
on WordPerfect Universe, 8-23-06.]
While similar to Example #1 above,
there is a significant difference: The custom styles are stored
inside the macro itself.
As with any WordPerfect file,
you can create and save one or more custom styles -- i.e., a
personal or company "style library" -- inside a macro
file (.WCM). The macro then acts like a briefcase to transport
these styles. The macro can be used to insert (or replace) styles
into any open document or template simply by playing the macro
while in that document or template.
In operation, the macro uses
a single StyleRetrieve() command to insert the custom style library
stored in the macro itself into the current document (.WPD),
or into a template (.WPT) that is open for editing. The command
might look something like this:
StyleRetrieve("C:\Documents
and Settings\Administrator\My Documents\WordPerfect\My WPX3 Macros\MyStyleLibraryMacro.wcm";
UserStyles!; CurrentDoc!)
Notice that this macro points
specifically to the macro filename on disk ("MyStyleLibraryMacro.wcm").
That is, it points to itself, not just to the folder which contains
the macro.
You can create the styles to
put in the new macro file, or use one of the methods in the next
section below (e.g., Method B) to insert
one or more existing styles into the macro file.
For an example of this, see Noal
Mellott's StyleLibraryPrimary
macro at WordPerfect Universe (here).
You can edit it to remove the styles you don't want, and/or edit
it to include your own custom styles. NOTE: Be sure to
edit and recompile it (with Save & Compile) at least once
or it might not work.
Notes and
tips:
- The StyleLibraryPrimary
macro's StyleRetreive command uses the standard path and filename
code (Insert > Other > Path and Filename) as
the command's first parameter, instead of the usual text string
or label. This technique allows the macro to be placed anywhere
on the system and still function properly, since the code always
points to the current location of the macro.
- Note also that the StyleRetrieve
command has a parameter to let you retrieve user styles,
system styles, or all styles. You most likely would
retrieve just your custom user styles.
- You can modify the macro to
insert custom Outlines, too. Outlines are just another
form of WP style, linked to one or more "level" styles
that each apply specific formatting.
- To do this, either create the
custom outlines in the macro file itself (Insert, Outline/Bullets&Numbering,
Create [or use Copy, then Edit]) -or- retrieve them into the
macro file with Insert, Outline/Bullets..., Options, Retrieve.
Once the custom outlines are embedded in the macro file, edit
the macro's code to include a OutlineStyleRetrieve()
command. [You can copy the macro's existing StyleRetrieve() command -- with all its parameters -- and simply
add the word Outline to the beginning of the command line (with
no spaces, as above).]
- More on custom outline headings: As an example, to create automatically
numbered Legal-, Standard-, and Roman-style headings, see Legal-style Headings: How to combine Outline
numbering with a default or custom Heading style formatting to
create automatically numbered Legal Headings.
- In a later WordPerfect
Universe post Noal showed a code snippet that you can add
to the top of his macro (or use in any macro) that can rename
existing styles. The code was basically the following (where
<Original> and <New> represent the original style
and new style name, respectively):
- Error(Off!)
StyleEditBegin("<Original>"; CurrentDoc!) StyleCodes (WithoutOffCodes!; CurrentDoc!)
StyleRename("<New>")
SubstructureExit() StyleEditEnd(Save!)
Wait(3) Error(On!)
- If you need to use the macro
frequently, you can assign it to a menu, toolbar button, or keystroke
combination. See here.
|
"Clipping" custom
styles from other documents
Here are several methods you
can use to copy a style that was either created by someone else
or created in an earlier version of WP on your own system. The
methods copy the styles from an existing document to either
your current document or your default (or other) template. (Copying
to a template makes it available for future use.)
Method A: "Block retrieve" styles
|
This is slightly different from
the traditional method given above. Here, you don't need to first
save the style to a disk file, if the document containing the
style is still available on your system. It is similar to the
traditional method in that it copies all user-created
styles from the source document. You can then choose which ones
to add to your default template.
Step 1. Make sure the source document that contains the
custom style is available on your system (it doesn't have to
be open).
Step 2. Open the target document or a blank document.
Click on Format, Styles, Options button, Retrieve. In the "Retrieve
files from..." dialog that pops up, browse to the filename
of the document that contains the desired style and choose it.
Click on the "User styles" radio button.
Note: In the Style type area,
the options are: "Both" - this retrieves both the styles
you have created and the preset styles provided with WordPerfect;
"User styles" (this is the one you want here) - retrieves
only the styles you or other persons have created; "System
styles" - retrieves only the preset styles provided with
WordPerfect. Also, when you retrieve a file the styles in that
file are saved with the active (current) document. To save
them in the default template, see step 3.
Click OK. The custom styles in
the original source document should show up in the Styles dialog
"Available styles" list of the current (target) document.
Step 3. While still in the new document, you can copy
any new style to your default template with Format, Styles, <choose
the new style from the "Available styles" list>.
Click the Options button, then click Copy, Default template,
OK, Close. Repeat for other custom styles you want to add to
the template.
|
Method
B: Retrieve
a single style
|
This approach lets you "grab"
a single style from a source document containing the style
-- perhaps a document originally created by someone else on another
system.
Step 1. Open the document that contains the desired custom
style. Use your mouse or keyboard to select a single word and
apply the style to the word. The word should be on its own
line with no other codes or text.
Step 2. Open Reveal Codes. Put the cursor in front of
(i.e., to the left of) the style code, and look at the information
on the style code itself.
Note that there are three basic
types of styles: Character, Paragraph, and Document (or Open).
The type should be visible on the code itself in Reveal Codes.
The first two style types (Character and Paragraph) are paired-code
styles; the latter (Document) is produced by a single code that
remains in effect until replaced by another Document style.
Step 3. Select the style code and the word. If
the style is a Character or Paragraph style, be sure to select
both the beginning code and the ending code as well as
the word to eliminate spurious formatting. If it's an Open code,
just select the code and the word.
Step 4. Copy the code(s) and word to the clipboard with
<Ctrl+C>.
Step 5. Open a new, empty document (or other document)
and paste the clipboard contents into it with <Ctrl+V>.
Look in the "Select style" drop list on the Text property
bar; you should see the new style appear in the list along with
any other styles stored in your default template.
Step 6. While still in the new document, you can copy
the new style to your default template with Format, Styles, <choose
the new style from the "Available styles" list>.
Click the Options button, then click Copy, Default template,
OK, Close.
|
For intermediate/advanced
users: You can write a macro to insert
a style into any document or template. This might be useful
in distributing a style to many users in an organization.
|
Here are some examples using
this technique, that work in (at least) WP8-WPX4.
The first create a bold, underlined
red character style in the current
document (only). The second does something similar (creates
a red character style in the current document)
but with a little more error-checking.
Example 1. Here's how to create one using Arial
Black, 10-point font. (Obviously, edit the code to use your preferred
font, font size, color, etc. To copy the code into WordPerfect,
see Footnote 1)
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 use the style:
StyleOn ("SampleStyle")
Since WP9, you cannot record
a style, you have to code it manually. (I cheated: I used WP8
to record things and then edited the results.)
Example 2. Here's a macro posted by Kenneth Hobson
on WordPerfect Universe (here)
that (1) stores all styles in the document (default and custom)
in a variable array; then (2) checks to see if the to-be-created
style exists in the array (if not, it creates it); then it (optionally)
inserts the style at the cursor location.
Note that the first time you
play it in WordPerfect you will see a harmless error message
about the obsolete (but still functioning) GetData command. Ignore
it and Continue compiling the macro.(To copy the code into WordPerfect,
see Footnote 1.)
// StyleColorRed.wcm
by Kenneth Hobson.
// Get style names in current document:
GetData(x;Styles!;Count!;CurrentDoc!)
Declare aStyles[x]
ForNext(i;1;aStyles[0])
GetData(y;Styles!;Name!;CurrentDoc!;i)
aStyles[i]=y
EndFor
// Check for
the existence of a particular // style name in
the current document:
loc="ColorRed" IN aStyles[]
If (loc=0) // if it doesn't exist, create it:
StyleCreate("ColorRed";CharacterStyle!)
StyleEditBegin("ColorRed";CurrentDoc!)
StyleCodes(WithOffCodes!;CurrentDoc!)
TextColor("Red") // or use TextColor(;255;0;0)
SubstructureExit()
StyleEditEnd(Save!)
EndIf
// Insert the
style at the cursor location:
StyleOn("ColorRed")
If you add an "Else"
condition to the If/Endif segment (i.e., to execute if the style
exists), you could use it to display a message or perform some
other function. |
|
Page
Top
How
to remove styles from a document, custom template, or the default
template
|
Removing
an individual style from
a document or template
Note that you can delete a text
style that you have created but you cannot delete any of the
preset styles provided with WordPerfect. However, when you delete
a custom style, you can delete just the style's formatting codes
or you can delete both the style and the formatting codes.
Method A
1. Open the document. Click Format,
Styles.
2. Choose the style from the Available Styles list box.
3. Click Options, Delete.
4. Choose the style you want to delete from the Select Styles
To Delete list box.
5. Enable one of the following buttons:
- Including Formatting Codes --
deletes the style codes and the formatting codes
- Leave Formatting Codes In Document
-- deletes only the style codes
Method B
Create a small macro to delete
the style (see Footnote 1). If the style is
in the currently open (for editing) document or template, the
following deletes it while keeping the contents (text) to which
the style was applied. Be sure to change "MyStyle"
to your custom style's name (but retain the quote marks).
StyleDelete (Style:
"MyStyle"; Codes: LeavingCodes!; Library: CurrentDoc!)
To remove a style from the default template, see below.
Removing
all unused custom styles from a particular document or a custom
template
WPLOOK
The easiest way to remove all
unused styles at once from a particular document (closed, on
disk) is to use the free, standalone Corel file repair utility,
WPLOOK.EXE.
Removing all unused styles is
handy if (1) you hate scrolling through dozens of unused styles
in the Styles list, or (2) you want to reduce the size of the
document (but only slightly), or (3) you do not want to share
any custom styles (except those that are needed to format the
document) with a recipient of the document. The latter is often
done with macros, too, which are just a type of WordPerfect document.
To download and use WPLOOK.EXE,
see Laura
Acklen's article about using WPLOOK her website. If enabled
to do so with a checkbox on its menu, WPLOOK removes just those
styles that are not in use in the document. It does not remove
styles that are part of the template on which that document was
based.
Other methods
You can remove individual
unused custom styles from a document or custom template with
the method described in the next section. Just open the file
for editing and click Format, Styles; or, if it is a template,
select the proper category and template name in steps 2 and 3.
Note that if the custom style is part of the default template,
it will be removed from the default template as well. (Another
good reason to back up the default
template before removing styles.)
You cannot delete shipping ("system")
styles (Heading 1 .. Heading 5).
Removing
a custom style from the
default template
Caution: If you edit the default
template, or any template for that matter, it is always a
good idea to make a backup of it first.
1. Click on File, New From Project
(or just File, New in WP8).
2. In the drop-down list under
the "Create New" tab, select (i.e., click on) the category,
"Custom WP Templates."
3. Select "Create a blank
document." This is the (oddly named) default template on
which all new (blank) documents are based.
4. Click the Options button,
then select "Edit WP Template." The default template
should load on screen. (It will have a .WPT filename extension
at the top of the window.)
5. Click Format, Styles, and
choose the style to delete. Click Options, Delete to bring up
a dialog where you can delete the style.
6. Click File, Save and close
the template.
|
Page
Top
|