| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Apr 16, 2021
|Splitter - A macro that splits the current document into two or more sequentially numbered files on your disk|
See also Clipper
- A macro that lets you select material in the current document (or any
open WP document) and automatically clip (copy or move) it to a
separate temporary document.
Splitter.wcm will split the current document into several new (and incrementally numbered) files on disk, such as:
The macro simply copies selections (delimited by text markers you added) from the current document and
saves the selections in a series of new, sequentially numbered files in a specified
(Note that if a numbered filename already exists in that storage folder, it will be overwritten. An optional message will pop up to alert the user to this situation, but it is better to move or rename these files before using the macro again.)
The position of the file's number — before or after the root filename — can be specified, as well as its padded size, beginning number, etc. (see below).
This macro might be useful as well in preparing to create subdocuments from a single file in preparation for using WordPerfect's Master/Subdocument feature. [Later, the subdocuments can be automatically added to the Master with a macro such MakeSubs]
If you just need to clip parts of any open
document into a separate on screen document, see Clipper.
Download and extract the macro from the download file (◄- left sidebar),
and place it in your default or supplemental macro folder. (See the
"Downloading..." link in the left sidebar if you need help.)
Make a copy of your original document as a backup. Then -
Modify the macro. (A WordPerfect macro can be opened and saved like any other
document.) Normally, this is a one-time procedure, and is easy to do.
Play the macro on any open file that has the appropriate separators (#1
above) in it.
Once the separate files are created they can be used as Subdocuments in a Master document (See MakeSubs in the Library.)
Notes, cautions, and tips¤ The macro starts from the very top of the document, and creates newly numbered files in sequence. The new files should then be edited to make sure they contain the proper text, formatting, etc.
Changes in formatting are sometimes the result of placing the separator in the wrong location in the original document, or because of changes in formatting above the separator location(s) that carry (or fail to carry) forward into the new, split document.
Methods exist — such as using WordPerfect custom styles at the top of each document — to ensure formatting is consistent across several related documents. [See (e.g.) the tips on the MakeSubs page — particularly Charles Rossiter's tip here, which also applies to documents split (copied) from a source document.]
¤ By design, the macro will overwrite any existing files of the same name in the new folder. If you want to preserve earlier versions of those files, you should relocate them before playing this macro (or at least rename the next batch of files using the vName variable in the User Modification Area). By default, a "Yes/No" warning is given; this message can be enabled or disabled in the macro's redlined User Modification Area.
¤ There is another Messagebox() command that can pop up a message at each "splitting" point. It may be useful for new users that are not used to the operation of this macro. You can enable or disable this message with a variable in the User Modification Area.