|
Loading new documents based on custom
templates
[This page was taken from "Loading custom
template documents" in the author's Automating
WordPerfect Templates (a PDF document).]
Related pages on this site:
- To create, find, modify, or fix your own
custom templates, see Custom
Templates
- For more information on the WordPerfect default
template, see The default template
- how to find it, modify it, or fix it
- For a way to create a custom "menu"
for loading your documents, see How
to Create a Vertical Toolbar with Text Buttons to Access Your
Favorite Folders, Templates and Files (a PDF document;
09/17/07, 150Kb)
- To create a custom, automated ("prompted")
template, see "Automating Templates"
|
|
Note
To create, find, modify, or fix your own
custom templates, see "Custom
Templates." The following
material assumes that one or more such user-created custom
templates has already been created and exists on your computer.
It explains how to more easily load a new document based
on one of these custom templates. |
Loading new documents based
on custom templates
The standard method of loading a new document
based on a custom template is to use File, New from Project (or
File, New in WordPerfect 8), then select the category and name
of the Project, then click Create.
However, there are easier and faster ways,
especially if you frequently use the same template-generated
custom documents. One method uses a new toolbar button, and the
other uses a macro (which you can record yourself).
Method A: Use a toolbar button
that points to the template
This method uses a toolbar button on your
default or custom toolbar that directly "points" to
a template. (See Footnote 1.) You need only
click the toolbar button and the document loads.
Note, however, that this works best with
only one version of WordPerfect installed on your system. The method uses the most recently associated WordPerfect
filename extension for templates in Windows Explorer. Therefore,
the method loads that version of WordPerfect (e.g., WordPerfect
12) along with the document even if you start from an
earlier version (e.g., WordPerfect 8). This might be confusing,
and can also take up system resources on some systems.
But if you have only one version of WordPerfect
installed, the following procedure is easy to use and the result
is an icon that loads a document in a jiffy:
Step 1.
Right click on the Toolbar you want to use
to hold the new button, and select Edit from the context menu
that appears.
Step 2.
Click on the Programs tab (not the Macros
tab), and click the Add Program button.
Step 3.
In the Open File window, change the File type
(in the lower left corner) to "WP Templates (.wpt)."
Step 4.
In the browse window, locate the desired template
on your hard drive, select it, and click Open. A new icon will
appear on your toolbar.
Step 5.
Right-click the icon, and select Customize.
Change the Button text, Quick Tip, and Image, as desired. (To
change a button's icon image, see here.)
Step 6.
Click OK to save your changes, and click OK
to back out of all dialogs and close the Toolbar Editor.
Tip
For an alternative to adding toolbar buttons
to a standard or custom toolbar, see How
to Create a Vertical Toolbar with Text Buttons to Access Your
Favorite Folders, Templates and Files (a PDF document,
150Kb).
Method B: Use a macro to
load a new template document
Another method is to use a very simple "loader"
macro that can be played from the toolbar or a menu item. The
macro selects the template and loads a new document based on
it. (There are no differences in terms of usage or speed of execution
between this method and the preceding one.)
If you need access to only one or two frequently used templates,
you might want to create just one or two buttons on a Toolbar
to play these loader macros. On the other hand, if you have several
templates such as letters, envelopes, and invoice forms
it may be better to create a drop-down menu on the top
menu bar, and populate it with items that play the various macros.
Both techniques are discussed below.
Create the macro first
Step 1.
In WordPerfect 9 and later (see Footnote 2): Open a blank
document with File, New.
Step 2.
Click Tools, Macro, Record. Give the macro
a name (e.g., Load my letterhead), then click Record.
The Macro Property Bar appears just above the main document area.
Step 3.
Click File, New from Project. Select the template
or Project you want to use, then click the Create button. The
document will load on screen. (If a Template Information dialog
appears, you would normally fill in its fields; but for the procedure
here, click Cancel to remove it from the screen. At this point
you only want to load a new document based on the template and
not do anything else that might get recorded.)
Step 4.
Stop the macro recording by clicking the far
left button ( ) on
the Macro Property Bar (its Tool Tip says "Stop macro play
or record").
Step 5.
Close the document on screen with File, Close
(i.e, don't save it).
Step 6.
Test the macro with Tools, Macro, Play. The
macro should immediately load the document in the usual manner.
Step 7.
Repeat the previous steps to create a differently
named macro for each template that you want to access this way.
then play it with a mouse click:
As mentioned above, at this point you can
either create a toolbar button to play each macro, or you can
create a drop down menu on the top menu bar with selections that
play your macros. Either or both of these methods -- discussed
next -- can be used to automate daily tasks by playing macros.
Method B1: Create a toolbar
button to play the macro
Step 1.
Right-click anywhere on the toolbar, then
click Edit. The Toolbar Editor appears.
Step 2.
Click the Macros tab, then click the Add Macro
button. From the Select Macro window, choose the loader macro
you created above, then click Select. Usually, you can answer
the "Save macro with full path?" question with "No"
since WordPerfect will automatically look for the macro in one
of the two folders specified in Tools, Environment, Files, Merge/Macro.
Step 3.
A small gray "cassette" icon appears
on your toolbar. Right-click on it an choose Customize. Give
the button a name in the Button Text field and a Quick tip to
display when you pass your mouse over it. Click on the Image
Edit button, then click Clear to remove the default icon image.
Then use the tools to create your own custom icon (see Footnote
3). Click OK all the way back to the document window. Note
that whenever the Toolbar Editor is on screen you can move a
button by dragging it, or delete it by dragging it from the toolbar.
Method B2: Create a drop
down menu to play macros
Alternatively, you can create a drop down
menu with selections that play your loader macros. This method
can be use to play any macro on your disk.
This is a similar method to the previous one,
since it also uses a loader macro to load the template document.
However, instead of toolbar buttons, you create a menu. Each
item on the menu plays a different loader macro.
Step 1.
Right-click on the top menu (the one with
File, Edit, View, etc.). Click on Settings from the context menu.
In the Customize Settings window that pops up, click on the Menus
tab and choose menu you want to use in the Available menus list.
Generally this is the <WordPerfect X Menu>
(where "X" is the WordPerfect program version number
that is loaded), unless you have previously created a customized
menu in which case, click on that one. Click Edit to bring
up the Menu Editor.
Step 2.
In the Menu Editor window you'll see an indented
box on the right labeled "Menu" with an icon inside
it.
Drag the Menu icon from this box up to
WordPerfect's top menu, to the right
side of other menu items.
Step 3.
Put your cursor over this new menu item (which
is simply labeled "Menu"), and when it is selectedit
turns dark bluedouble click it. This will allow you to
change the name in the Menu Item field to "Letterheads,"
"Stationery," or something equally useful, and add
a floating description (Quick Tip). You can type an ampersand
(&) immediately before any letter in the name that you want
to use as a mnemonic, which will select the macro if you use
the Alt+<letter> key combination. Click OK when you are
done entering the name.
Step 4.
While the Menu Editor window is still open,
click on the Macros tab at the top, and then click the Add Macros
button. Select the macro that loads your letterhead or other
desired template. Click Select to close the Select Macro window,
and click anywhere in a blank area of the Menu Editor window
to make it active again. You'll notice the macro's name was placed
on the top menu line, but next to your new menu item.
You'll want to put it under the new item, and change its
name:
Step 5.
Place your cursor over the new macro's name
on the top menu until it turns blue (i.e., it's now selected),
then drag it with your left mouse button over to the Letterhead
menu item then drag it down to the blank (gray)
area that pops up just under the new menu item and drop it
there. (Sort of "go west, then go south" with your
mouse, while holding down the left button.) This is where the
first menu selection will appear.
Note
For additional items you can drop the name
either below or above any existing menu items. A heavy horizontal
line will appear to guide your placement. You also can add a
separator line between menu items by dragging and dropping it
from the Menu Editor window.
Step 6.
Rename the menu selection by highlighting
it with your mouse. Double click the macro's name and rename
it in the pop up box. You can type an ampersand (&) immediately
before any letter in the name that you want to use as a mnemonic
and that will select the macro if you use the Alt+<letter>
combination.
Step 7.
Click OK when you are done to close the Menu
Editor.
Step 8.
Click Close in the Customize Settings window.
Done!
Tip
For an alternative to using a menu, see How to Create a Vertical
Toolbar with Text Buttons to Access Your Favorite Folders, Templates
and Files (a PDF document, 150Kb).
|
|
Footnote 1
You can create a custom toolbar for
just such purposes: Click Tools, Settings, then double-click
Customize. Under the Toolbars tab, click Create. (When created,
be sure to toggle it "on" back in the Available toolbars
window of the Customize Settings dialog.) The new toolbar will
be saved as part of your default template, but it can be copied
to other templates using the Copy/Remove... button on the target
template's Template Property Bar.
Note that you can also create a desktop
shortcut to "point" to the template file (.WPT).
Clicking the desktop shortcut will open WordPerfect and load
a new document based on that template. However, unlike in WordPerfect
9 and earlier versions, in WordPerfect 10, 11, and 12 (at least)
any startup template macros (i.e., a template macro associated
with the Post New trigger) will not automatically play unless
WordPerfect is already open.
Finally, you can create a vertical toolbar.
It can even load macros and open favorite folders. See How to Create a Vertical
Toolbar with Text Buttons to Access Your Favorite Folders, Templates
and Files (a PDF document, 150Kb).
Footnote 2
IMPORTANT: In some versions of WordPerfect
(e.g., version 8) this method of recording a loader macro might
not work to produce a macro. If that happens or you simply
want a faster method of creating such macros you can write
a simple one-line macro containing the TemplateSelect() command.
Be sure to use the full drive\path\<template name>, and
enclose everything in double quotes.
For example: TemplateSelect ("C:\Documents and Settings\Administrator\Templates\My
Letterhead.wpt")
Footnote 3
If you are "artistically challenged"
and want to have something more than a picture of an audiocassette
on the toolbar button that plays your macros (i.e., the default
icon that appears whenever you add any new macro), here's one
way to do it. Since WordPerfect is full of features you can add
to a toolbar with the Toolbar Editor's Features tab, these already
have pre-drawn icons associated with them. You can copy any of
their icon images to your new macro's toolbar button and modify
it if desired.
Here's how:
Scroll through the features, select one of
them and add it (temporarily) to the toolbar, then edit this
temporary icon (right-click it, then click Customize, Edit) and
click Copy to copy the image. Click OK back to the Toolbar Editor,
and edit your new macro's icon. Clear the gray audiocassette
image, and paste the new image into it, making any desired changes,
then click OK to get back to the Toolbar Editor. Finally, with
the Toolbar Editor on screen, right-click the temporary icon
and select Delete. |