|
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
(Q&A) 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
Graphics tips (many graphics you create or insert are controlled
by sytles) |
Creating and applying
custom text styles
Notes
|
For more general information about text styles, with several tips, examples, and links to related
pages on this site, see http://wptoolbox.com/tips/Styles.html.
For tips on creating and using graphics styles, see http://wptoolbox.com/tips/GraphicsTips.html.
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.
Much of this page is derived from WordPerfect
9's Help module. You might also want to consult your own WordPerfect's
Help (<F1> key). |
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.]
Basically, 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, sometimes even including ordinary text characters or symbols
so you can quickly insert them when applying the style.
They 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).
Moreover -
- 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 pre-set 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 styles 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 styles these affect entire paragraphs (up to the
point where you press <Enter>). 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.
- WordPerfect also has several built-in Outline styles, which are a special
form of Paragraph style.
- Document styles (a/k/a/ "Open styles") 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.
Notes
- 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 (i.e., 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 (i.e., Character and Paragraph) are paired-code
styles. If you delete one code 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.
How to create and apply
a new text style (from scratch)
[To modify an existing text style,
see below. To modify outline styles
(which are specially numbered paragraphs), see here.]
Step 1. Click
Format, Styles.
Step 2. Click
the Create button. This brings up the Styles Editor dialog.
Step 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, only one version of that style will
active in the new document; the other will be deleted. If you
open an older document or a document from someone else that
has a style in it with the same name as one of your styles,
your current style will take precedence.)
Step 4. Type
a description for the style in the Description box.
Step 5. Choose
a style type from the Type list box. (See more on the three general
types of styles above.)
Step 6. Using
the Styles Editor's menu and/or property bar (the "toolbar"
under the menu), click the style attributes you want to apply.
Step 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. "<None>"
means the style ends when <Enter> is pressed, and is a
typical choice. "<Same Style"> means the style
"chains to itself," and thus will continue until you
move the cursor past the last ending code of the style in Reveal
Codes, or you deliberately apply a new style. You can also select
an existing style that should follow (i.e., be chained to) the
current style when you press <Enter>.
- Enable the Show 'Off Codes' check box to
display the codes that take effect when a style ends. (See Tips
below for some practical uses for the new code that appears when
you enable this check box.) The other checkbox, "Reveal
codes," 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 relating to the Styles Editor:
- 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 "Formatting custom templates," and the tips in
that section).
- When you create [or modify] 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.
- If the checkbox at the bottom of the Styles
Editor labeled "Show 'off codes'" is enabled (ticked),
you should see a long code in the Contents pane entitled "Codes to the left are ON - Codes to
the right are OFF." This code is
a sort of placeholder for the text that will appear when the
style is applied to it.
- Hence, you can tell WordPerfect to apply
formatting to the beginning of the text ("on" format
codes are placed on the left side of that long code) and end
it at the end of the style ("off" codes or replacement
codes are placed on the right side of that long code).
- To apply such paired codes (e.g.,
italics, underlining, etc.), it is easier to use <Shift+arrow>
to select this long code, then apply the paired
format codes to it (e.g., by using the Editor's property bar
to apply italics formatting). Single format codes can
be directly placed either before or after this long placeholder
code, depending on whether they should afftect the style's text
or they should follow that text (e.g., a graphic line used to
underline the block of text). For single codes, just position
the cursor before or after the placeholder, and use either the
Editor's menu or its property bar to insert the format code.
- Example: If
you have a document with default body text line spacing set to
1.5 lines, and wish to have quotations indented in single-space
[screen shot here],
you can add a line spacing code after that long code to
restore the following line spaces to 1.5 [screen
shot here].
- Example: This
long code is useful in "marking" your own custom styles
for display in a Table of Contents, reducing the space between paragraph headings
and following text, etc.
Step 8. Apply
the style.
All users: You
can apply the style at the current cursor location (then type
some text) or you can apply it to previously selected text. To
do so, you can choose the style by from the "Select Style"
drop list on the text property bar, or by clicking Format, Styles,
<style name>, Insert.
Advanced users:
You can create a small macro to apply the style, then assign
the macro to a toolbar, keyboard shortcut, or menu (as explained
here). For example, if the custom
style is named MyNewStyle, then use this macro command:
StyleOn ("MyNewStyle")
Note that your custom style such as
a Character style might require you to select text first
before applying the style. Hence, a macro like this will check
for text selection:
If (Not ?BlockActive) Messagebox (;; "Select text first!")
Quit Else StyleOn ("MyNewStyle")
Endif
Tip: If you
want to apply the style to several words or phrases wherever
they appear in the body of the document, see Footnote 2.
How to create a
"QuickStyle"
QuickStyles are styles created based on the
formatting in effect at the current cursor location. [This is
a similar feature to Format, QuickFormat,
which lets you copy the format of text and apply it elsewhere
in the document; however, creating a QuickStyle allows you to
save it as a new custom style.]
Step 1. Click
in or select the text that is in the format you want.
Step 2. Click
Format, Styles.
Step 3. Click
the QuickStyle button.
Step 4. Type
a name for the style in the Style Name box.
Step 5. Type
a description for the style in the Description box.
Step 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
Step 7. Click
Close.
Step 8. Apply
the style: 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
How to use "QuickFormat"
QuickFormat lets you copy the format at the
cursor location i.e., the format of text characters, a
paragraph heading, or a table cell and apply it elsewhere
in the document.
Though similar to a QuickStyle,
it is generally used to quickly modify just the current document's
text. Therefore, if you think you might need to save the
formatting as a style for future documents, consider creating
a QuickStyle above instead.
[The following is from WordPerfect X5's Help
<F1> key; however, the procedure should be similar in other
versions).]
"You can copy the format of text and
apply it to other text in a document. If you want to copy selected
text, then formatting attributes, such as font, font size, and
font style, are all copied. If you want to copy the heading in
a paragraph, the paragraph style as well as the font and its
attributes are copied.
When you copy the format of text, you automatically
create a text style. Changing text that has been formatted using
a text style also changes other text in the document that uses
that style.
Step 1. Click
in the text whose format you want to copy.
Step 2. Click
Format, QuickFormat.
Step 3. Enable
one of the following options:
- Selected characters copies the format
of the font and its attributes
- Headings copies the format of the
paragraph and its styles, and the font and its attributes
- Table cells copies cell attributes,
text colors, fonts, fills, and lines
- Table structure copies table borders,
fills, default line, and table style
Step 4. Click
OK.
Step 5. Drag
the QuickFormat paintbrush pointer [which looks like a paint
roller] over the text to which you want to copy the format.
Step 6. Click
Format, QuickFormat."
Tips
- You can also enable or disable QuickFormat
by clicking the QuickFormat button (which looks like a paint
roller).
- QuickFormat is disabled when no check mark
displays beside the QuickFormat menu command.
- If you might need to save the style
for future documents, consider creating a QuickStyle above
instead.
Page
Top
Modifying existing styles
If you wish to create a modified version of
an existing style:
It is always a good idea to first make
a copy of an existing style (or anything else you want to
modify), saving it with a different name, then modify
the copy (not the original). [See also "Retrieving custom
(user) styles from another document or template" below.]
Renaming new custom styles that are based
on existing styles is especially useful in an organization where
many users might share documents, compared to a solo practice
where modifying the original item without renaming it isn't usually
a problem later on.
- To make a copy
before you begin making modifications, use the Options button
on the Format, Styles dialog. You can make a copy just to the
current document, then if all goes well, you can save the copy
to the default template (next section).
- To modify the copy:
The easiest way is to apply the style in a document, then double-click
the [Style] code for that style in Reveal Codes. This brings
up the Styles Editor, where you can use its menu to Insert a
Tab, or use its Format, Paragraph menu to add an Indent, and
so forth. You can also insert format codes such as [Bold] or
[Large] from either the Styles Editor's menu or its property
bar.
- Note that if the style has not yet been applied
in the document, but exists in the template that spawned that
document, you can edit the style from the main WordPerfect
menu with Format, Styles in much the same way you can create
a style from scratch as explained above. Again,
it is wise to make a copy of it first.
- If you modified a standard (i.e., built-in)
WordPerfect style instead of making a copy of it to modify, you
can reset the style to the factory default state. See below.
Saving custom styles
to your default (or other) template
Notes
|
If you intend to use a newly created
custom style or a modified style in new, blank documents,
you will need to copy it to your default (or other) template,
as explained in this section.
You can also copy custom styles from
another document or template to a disk file, then import
(retrieve) them into the default or custom template. See the
next section, under "Traditional
methods". |
Method
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
or a custom template.
Saving styles 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.
Saving styles to a custom template -
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 (retrieve) them into the template. See the next section, under "Traditional methods".)
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.
- If you load a document with a custom style
(including Outlines, which are also styles) that has the
same name as an existing style on your computer, your
version of the custom style will become the "active"
version, essentially replacing the imported version for that
document. (See this
thread on WordPerfect Universe for how this affected users
in a law firm with a custom Outline style created by an attorney
who propagated it to his staff.)
Traditional methods
Method 1. 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.
Tips
- 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.
- 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.
Method 2. Import custom styles from one template into another
template
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
Method 1. Using a small macro to retrieve user (i.e., custom)
styles
Method 1a: 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-filename to the
"target" template/document that contains the user styles
you want to import into the current document or template. Be
sure to retain the double quote marks, and note that the macro
below should be all on one line:
StyleRetrieve("drive-path-filename";
UserStyles!; CurrentDoc!)
Note that for Outline styles, use:
OutlineStyleRetrieve("drive-path-filename";
UserStyles!; CurrentDoc!)
Play the macro in the current document. It
should retrieve all custom styles (or Outline styles) into the
current document. Note that this will overwrite current styles
with the same name.
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. Needless to say, always
make a backup of a template before modifying it.
If you need to use the macro frequently, you
can assign it to a menu, toolbar button, or keystroke combination.
See here. |
Method 1b: 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 2) 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.
|
Method
2. "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 2a: "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
2b: 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.
|
Method 3. 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 example macro creates a bold, underlined
red character style in the current document
(only). If text was selected first, it will apply the style
to the selected text; otherwise, it will apply the style, and
you should then immediately type the text between the paired
style codes (press Enter to move past them).
The second example macro does something similar
-- it creates a red character style in the current document -- but with
a slightly different technique.
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)
// Macro begins: //
If text was selected, mark it:
If(?BlockActive)
BookmarkCreate("Temp_mark")
Endif
OnError(SkipApplyStyle@) //
(if the named style already exists, skip this segment)
StyleCreate (Name: "SampleStyle"; Type: AutoCharacterStyle!;
Library: CurrentDoc!)
StyleEditBegin (Style: "SampleStyle"; Library: CurrentDoc!)
StyleDescription (Description: "Sample character style")
StyleEnterKeySetting (Action: StyleOff!)
StyleCodes (State: WithOffCodes!; Library: CurrentDoc!)
Font ("Arial Black Regular")
FontSize (10p)
AttributeAppearanceToggle (Attrib: Underline!)
TextColor (Red: 255; Green: 0; Blue: 0)
SubstructureExit ()
StyleEditEnd (State: Save!)
Label(SkipApplyStyle@)
// Reselect the text if it
was originally selected:
OnError(SkipFindBookmark@)
BookmarkFind("Temp_mark")
BookmarkBlock("Temp_mark")
Label(SkipFindBookmark@)
// Apply the style:
StyleOn ("SampleStyle")
// If text was selected, move
the cursor before exiting:
If(?BlockActive)
PosBlockBottom
SelectOff
Endif
// Remove the temporary bookmark:
BookmarkDelete("Temp_mark")
Return
// Macro ends
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 reset a modified
style to the WordPerfect default state
For the current document, simply click on Format, Styles, <style name>,
Options button, Reset.
For the template (default or custom), edit the template with File, New from Project (or
just File, New in older versions), choose the category from the
Create New drop list, then click on the name of the template
to reset. Then:
- Click the Options button, then click Edit
WP Template.
- When the template opens (it should have a
filename at the top of the WordPerfect window that has a .WPT
extension), click Format, Styles, <style name>, Options
button, Reset. Answer Yes to "Reset style to default state?,"
then click Close to retutn to the template.
- Save the template: click the Close button
on the template property bar and answer Yes to the message about
saving.
If the Reset button is grayed (greyed)
out, this usually means that the style
is a user-created custom style and not a standard WordPerfect
style that was modified. You can edit the user-created style
(with Format, Styles) to change it, or simply delete it.
Page
Top
How to remove styles
from a document, custom template, or the default template
Removing an individual
custom 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
(even modified ones) provided with WordPerfect; however, you
can reset them to their default state (see above).
When you delete a user-created custom style,
you can delete just the style's formatting codes or you
can delete both the style and the formatting codes.
Method 1
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 2
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
Use Corel's 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
|