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

Page updated Sep 15, 2019

TabSet25 - Automatically set left tabs every 0.25 inches (to modify this amount see below)

Download TABSET25.ZIP (v1.3; 12/28/16; 11,888 bytes)

Written in WPOX8 but should be compatible with WordPerfect 8 and later versions

WordPerfect 11 users: See important information about using macros in the first release of WP11 (11.0.0.233) at the top of this page.

Downloading, Documentation, Modifications, and Support


Related pages -

•  How to create custom tab settings for outlines and bullet lists

•  Custom styles (includes creating, saving, retrieving, resetting, and removing them)

•  Several easy ways to play macros, etc.
Note: This macro uses fractional inches to set multiple tab stops, and it has worked very well on many different systems and versions of WordPerfect since its initial release in 2004. However, it has been reported that it might not function on systems working under the Metric system (centimeters, etc.). While it might be updated to accommodate Metric system users, given my limited time and resources there is no guarantee of that. Meanwhile, see Macro Example #1 below for some code to use for Metric tab stops.

Operation

Just play the macro to set new tab stops every 0.25 inches (up to the apparent program maximum a7 9.75 inches [40 tab stops]):

TabSet25 ruler bar

From a menu that appears you can choose to set the new tabs -

TabSet25 menu dialog

•  for the currently selected text -- e.g., this is useful to "compress" the space adjacent to the numbers, letters, or bullets in lists or outlines when they are selected before playing the macro (tab settings in effect before the selection are restored immediately after the selection); or

•  starting at the top of the document and continuing forward; or

•  starting at the current cursor location and continuing forward.

The tab settings for any of these choices can be set relative to the left margin (the default) or from the left edge of the page (starting from the non-printing area).

The macro also sets three additional 0.25" tabs to the left of the margin, so that a back tab (<Shift+Tab>) following the new [Tab Set] code will "outdent" the following text in 0.25" increments. (Use more back tabs for greater outdenting.) These additional tabs are not shown on the [Tab Set] code, but they are there nonetheless.

Notes

¤  Tab settings inside separate WordPerfect substructures such as headers, footers,  text boxes, footnotes, etc., will apply to just that substructure if you choose to apply the settings inside them. (The program’s macro language considers them somewhat like a separate document with a top and bottom.)

¤  Tab settings affect paragraph formatting (anything that ends with a hard return or equivalent) so the [Tab Set] code that sets or changes them typically appears in Reveal Codes at the beginning of the current paragraph rather than at the cursor location (if different). This is by program design.

¤  WordPerfect seems to set a limit on tab stops: The maximum seems to be about 40 tabs, determined by WordPerfect for the document width and orientation.

Tips


■  You can remove individual tabs you don't need by click-dragging their triangle marks downward from the ruler bar with your mouse (see image above; if you can't see the ruler, enable View, Ruler on the WordPerfect menu).

■  To remove all of the tabs created by this macro just locate and delete the new [Tab Set] code that started them in the Reveal Codes window. This will reset tabs to what they were at that point (e.g., the default is typically every 0.5").

■  To set all tabs back to the default (usually every 0.5") further down in the document (this assumes you used the macro menu's option to either set tabs starting at the top or set them starting at the cursor location; if you selected some text and used the option to apply the tabs to the selection they will be automatically reset following the selection):

1. Place your cursor where the default tab setting should begin.
2. Click Format, Line, Tab Set.
3. In the dialog that appears, click the Default button, then Close.

This places a new default [Tab Set] code at the cursor location.


■  Menu defaults for the macro can be set in the redlined User Modification Area of the macro's code.

For example:

The actual Tab stop values can be changed in the macro code's two TabSet() commands (0.25" is the default).

You can also set the variable vMenu to zero to let the macro play without displaying a menu.

To make such changes:

Open the macro for editing (Tools, Macro, Edit) and after making changes, click Save & Compile on the Macro Toolbar that should be visible.

■  To insert the new tab settings in every new document (via the default template):

1. Play the macro in a new, blank document. From the macro's pop up menu, choose to "Start at top document." Notice the new 0.25" tabs that now show in the ruler area, and a [Tab Set] codes appears in Reveal Codes.

2. In Reveal Codes, select the new [Tab Set] code. (It is easier to do this by locating the cursor next to the code and holding down the <Shift> key while you tap the <Arrow> key once.) Copy the selection to the clipboard with <Ctrl+C>.

3. Double-click the [Open Style: DocumentStyle] code in Reveal Codes to open the Styles Editor.

4. Paste the new [Tab Set] code into the Contents field with <Ctrl+V>, just to the left of any other codes.

5. Check (i.e., enable) the box at the bottom of the Editor, "Use as default." Click OK, and answer Yes to the confirmation dialog that pops up.

Notes

¤  Be sure to un-check "Use as Default" before exiting WordPerfect to prevent unwanted further changes to the template.

¤  If you want to restore things at a later date, just open a new document and double-click the [Open Style: DocumentStyle] code. Delete the new [Tab Set] code, enable the "Use as default" box, and click OK. Then un-check it again before exiting WordPerfect.

¤  To set other formatting defaults for future documents see "How to set default formatting for new documents: A step-by-step guide" here.

■  (Alternative:) You can use the new Tab Set code inside a character style to quickly apply the custom tabs to a selection of text:

Character styles have several advantages when formatting a document, not the least of which they can act as "containers" for several different formatting codes -- e.g., to combine custom tab settings with a margin change, or to use them to set up WordPerfect columns around a particular selection of text (smaller tab settings often work better than the default tab setting in columns where text contains tabs, back tabs, or indents).

Here's an easy way to do it.

Once the new [Tab Set] code exists in the document you can -

1. select just that [TabSet] code in Reveal Codes (use Shift+arrow keys to make precise selections);

2. copy the code to the clipboard; and

3. paste it into a new custom character style's Styles Editor (Format, Styles, Create), perhaps named "TabSet25".

(Note: In the Styles Editor set the "Enter key..." to <None> and the Type drop list to Character to restrict the style to particular text. The Character style will then enclose just that text with a pair of "on/off" [Style] codes.)

Later you can edit the style (Format, Styles) and add other formatting in the Contents pane of the Styles Editor.

Notes

¤  Be aware that, by default, newly created styles are saved only in the current document and will be available in the property bar's Select Style drop list. On the other hand if the style is saved to your default template it will be available for all new documents. Either way, when the style is present in a document just select the desired material and apply the style to that material. For more details on the method for using and saving the new Tab Set style, see the footnote at OutlineTabs.html#fn1 (which method describes using the TabSet25 macro's results with an Outline style -- but it also applies to other styles).

¤  For more general information about custom styles (creating, applying, modifying, retrieving, resetting, deleting, and saving them) see CustomStyles.html.

■  (Alternatives for those familiar with editing or creating macros:)

Macro example #1.....

To use a small macro to set custom tab settings at the cursor location (or to a selection of text), the following is similar to some code in TabSet25. You can use it as a standalone macro with the 0.25" settings or with your own custom settings at the various tab positions.


To copy this code into your WordPerfect program to create a working macro, see here.

// Macro begins:
// Set tabs stops for the selection every 0.25 inch from left margin
// (To set them from the left edge of the page change Relative! to Absolute!)
TabSet (Origin: Relative!;
{0.0"; TabLeft!; 0.25"; TabLeft!; 0.5"; TabLeft!; 0.75"; TabLeft!;
1.0"; TabLeft!; 1.25"; TabLeft!; 1.5"; TabLeft!; 1.75"; TabLeft!;
2.0"; TabLeft!; 2.25"; TabLeft!; 2.5"; TabLeft!; 2.75"; TabLeft!;
3.0"; TabLeft!; 3.25"; TabLeft!; 3.5"; TabLeft!; 3.75";    TabLeft!;
4.0"; TabLeft!;  4.25"; TabLeft!;  4.5"; TabLeft!;  4.75"; TabLeft!; 
5.0"; TabLeft!;  5.25"; TabLeft!;  5.5"; TabLeft!;  5.75"; TabLeft!; 
6.0"; TabLeft!;  6.25"; TabLeft!;  6.5"; TabLeft!;  6.75"; TabLeft!; 
7.0"; TabLeft!;  7.25"; TabLeft!;  7.5"; TabLeft!;  7.75"; TabLeft!; 
8.0"; TabLeft!;  8.25"; TabLeft!;  8.5"; TabLeft!;  8.75"; TabLeft!;
9.0"; TabLeft!;  9.25"; TabLeft!;  9.5"; TabLeft!;  9.75"; TabLeft!})  
// (max limit seems to be 9.75")
Return
// Macro ends

Note that the measurement values in the code above are in inches, designated with a double quote mark suffix ("). Alternatively you could use the letter i for inches (e.g., 0.0i... 0.25i...etc.).

For Metric measurements you can use the suffix c for centimeters or m for millimeters. Obviously, if you use the example above as a model be sure to adjust the numerical values to correspond to actual Metric values for each tab stop. For example, using centimeters you could set the above snippet's values to something like this:
TabSet (Origin: Relative!;
{0.0c; TabLeft!;
1.0c; TabLeft!;
2.0c; TabLeft!;
3.0c; TabLeft!;

4.0c; TabLeft!;... })
Each tab stop would then be about 0.39 inches apart.

The same measurement suffixes (i,c,m) can be used as replacements in the other macro code snippets below.

Macro example #2.....

To set all tabs with the same space between them starting at the left edge of the page, use TabAdd() like the following 2-line macro, which sets them every 0.25 inches.

To copy this code into your WordPerfect program to create a working macro, see here.

// Macro begins:
TabClearAll  // Remove existing tabs (required to set all new tabs with TabAdd)

TabAdd(0.0"; TabLeft!; 0.25")
// Macro ends

Macro example #3.....

To set tabs every 0.25" (which can be changed to some other fixed value) relative to the current left margin and also allow proper Back Tab settings outside (i.e., relative to) that margin here's a macro to do it. (It also works on selected text.)

To copy this code into your WordPerfect program to create a working macro, see here.

// Macro begins:
// Sets tabs stops every 0.25 inches from the left margin - note that the
// next (bold) command could be set to some other dimension
// (e.g., 0.20). As written the spaces between tabs will all be the same.
//
vSpaceBetween:=0.25 // (sets dimensions for spaces between new tabs)
vSpace:=vSpaceBetween+"i"   // (adds an "i" for "inches")
// Convert current margin to inches:
vMar:=ConvertType(MarginLeft(); Inches!)
// Repeat as long as vSpace is less than Left Margin:
If(vSpace < vMar) 
    Repeat // Work backwards to find position for first tab stop: 
        vMar:=vMar - vSpace 
    Until(vMar <= vSpace)
Endif
vMar:=StrNum(vMar)
// Store 40 tab settings in an array:
x:=1
Declare(array[41]) // (specify array size)
Repeat
    array[x]:=vMar  // (store margin setting for element "x")
    x:=x+1  // (increment array's element number)
         // Increase the stored value for margin setting; then repeat loop:
    vMar:=vMar+vSpaceBetween
Until(x=41)
// Insert the new tab settings using the array's stored values:
TabSet (Origin: Relative!; {
array[1]+"i"; TabLeft!; array[2]+"i"; TabLeft!; array[3]+"i"; TabLeft!; 
array[4]+"i"; TabLeft!; array[5]+"i"; TabLeft!; array[6]+"i"; TabLeft!;
array[7]+"i"; TabLeft!; array[8]+"i"; TabLeft!; array[9]+"i"; TabLeft!; 
array[10]+"i"; TabLeft!; array[11]+"i"; TabLeft!; array[12]+"i"; TabLeft!; 
array[13]+"i"; TabLeft!; array[14]+"i"; TabLeft!; array[15]+"i"; TabLeft!;
array[16]+"i"; TabLeft!; array[17]+"i"; TabLeft!; array[18]+"i"; TabLeft!;
array[19]+"i"; TabLeft!; array[20]+"i"; TabLeft!; array[21]+"i"; TabLeft!; 
array[22]+"i"; TabLeft!; array[23]+"i"; TabLeft!; array[24]+"i"; TabLeft!;
array[25]+"i"; TabLeft!; array[26]+"i"; TabLeft!; array[27]+"i"; TabLeft!;
array[28]+"i"; TabLeft!; array[29]+"i"; TabLeft!; array[30]+"i"; TabLeft!;
array[31]+"i"; TabLeft!; array[32]+"i"; TabLeft!; array[33]+"i"; TabLeft!;
array[34]+"i"; TabLeft!; array[35]+"i"; TabLeft!; array[36]+"i"; TabLeft!;
array[37]+"i"; TabLeft!; array[38]+"i"; TabLeft!; array[39]+"i"; TabLeft!;
array[40]+"i"; TabLeft!})
Return
// Macro ends

- - -
Note: Macros #2 and #3 are based on macros posed by Larry Lewis at WordPerfect Universe here.