Toolbox for WordPerfect
Macros, tips, and
templates for Corel®
WordPerfect® for Windows®
updated Mar 24, 2017
|CODE2TXT - Change attribute codes to text markers (and vice versa)|
The Code2Txt macro on this page can change paired WordPerfect format codes to text markers or vice versa. However -
To replace (or augment) one or more WordPerfect format codes with one or more different format codes, see Ron Hirsch's Replace Codes - Plus macro on the Other Authors page here.
This macro (Change attribute codes to text markers.wcm) can -
The first function (convert format codes to text markers) is useful when converting (saving) a document to ASCII or ANSI text but you want to identify the old text attributes (i.e., paired format codes) with unique text markers, such as HTML tags or to replace WordPerfect format codes with Folio, Ventura Publisher, InDesign, or QuarkXpress markup codes, etc.
The second function (convert text markers to format codes) can be useful to restore a document saved after converting from codes to text markers with the first function, or whenever you want to convert identical, "marked" strings of text to formatted text (e.g., bold, redline, etc.). Note that you can also use it to convert text "marked" with ordinary words (up to 20 characters) and/or symbols (inserted with <Ctrl+W>).
The WordPerfect attribute codes that can be converted (in v2.13+) are:
You can choose any -- or all -- of these codes from a menu. You can also choose to retain the original paired format codes after converting the codes/markers, and/or delete all 'empty' code pairs (i.e., a pair of on/off codes without anything between them, such as [Bold][Bold]).
You might notice that some format codes such as [Color] are not listed. That is because they are not paired codes, even though they can be turned off later in the document with a corresponding code of the same type (in this example, a different [Color] code). On the other hand, the text attribute codes above are paired codes consisting of an "on" code and an "off" code.
Perhaps the best way to see what the macro does is to play it on a document that contains typical paired format codes such as bold, italics, and/or underlines (or any combination), using the first option on the macro's menu. These codes should be converted to the text markers you have chosen.
- - - - -
Download and extract the desired macro using the link in the left sidebar.
Place the extracted macro in your Default or Supplemental macro folder.
(See "Downloading..." for more help if you need it.)
Be sure to read the rest of this page before using the macro.
 Back up your document.
 Play the macro.
 An initial menu will appear [screen shot] to let you choose from the two basic options. Choose one of them and click OK.
 A two-page menu of options will appear. [Screen shot of first options page with 3 items activated; screen shot of second page (a continuation of first page).]
On the menus you can -
• optionally modify any beginning and ending markers for any item in those menu pages by deleting the entries in the fields; then
• check (i.e., tick) the adjacent checkbox to activate that item; then
• check (i.e., tick) of clear (un-tick) the optional checkbox choices at the bottom of the menu pages; and then
• click OK.
If the chosen menu item(s) is found the macro will change the item(s) to the paired markers (or paired format codes) shown on the same menu line(s) as the items you activated (i.e., ticked).
The materials and any software contained on this site are offered without warranty or guarantee of any kind, either express or implied, including but not limited to implied warranties of merchantability, satisfactory quality, fitness for a particular purpose, noninfringement, or those arising by law, statute, usage of trade, course of dealing or otherwise, and are provided on an "as is," and "with all faults" basis. The entire risk as to the results and performance of these materials is assumed by you. The author assumes no liability whatsoever to you or any other entity or third party for any special, incidental, direct, indirect, or consequential damages -- including without limitation any damages to equipment, or for loss of profits, for business interruption, for loss of data or other information, or for any other loss arising out of the use or inability to use these materials, techniques, suggestions, or software programs, even if the author has been notified of the possibility or actuality of such damages, or they are foreseeable. Materials on these pages have been prepared with reasonable care for educational and informative purposes. No representations are made regarding the use or the results of the use of any macro, suggestion, technique, or other material in terms of their correctness, accuracy, reliability, or otherwise, and you are again cautioned that you use them solely at your own risk. You are advised to make backups of any important files before implementing any macro, suggestion, or technique. Do not assume anything here is error free.
The above Disclaimer also applies to any communication the author may have with you.
The external links on this site, or in any related materials or communications, do not constitute an endorsement or guarantee of the linked sites, their visitors, or their associated owners, operators, or staff.