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 Apr 3, 2019

LineWrap - Converts single hard returns ([HRt]) at the end of selected lines or paragraphs to soft returns ([SRt]). This allows automatic wrapping of the selected lines at the right margin (a.k.a. "word wrap").

Double hard returns between the paragraphs (which must exist for the macro to work) are not converted so that individual paragraph structures are retained. See sample screen shots below.

Download LINEWRAP.ZIP (01/05/13; 4,457 bytes)

Compatible with WordPerfect 6 and later versions

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

Downloading, Documentation, Modifications, and Support

Related pages -

DelExtraHR - Deletes all multiple adjacent hard return codes and replaces them with a single hard return. [You could play it after using LineWrap.]

DeSpacer - Reduces multiple adjacent spaces to single spaces.

Note: This page and the download macro was previously named FixASCII. It was renamed on Jan 5 2013 to make it more descriptive of its purpose.


LineWrap.wcm very quickly removes single hard returns ([HRt]) at the end of lines in plain-text (ASCII-type) files that have been pasted or otherwise imported into WordPerfect -- or any document containing adjacent lines where each line ends in a single hard return -- and replaces them with soft returns ([SRt]). (See screen shots below.)

This allows "word wrapping" of the selected words, sentences, or paragraphs and makes reformatting such items or other copied material (such as e-mail messages, selected material from PDF files, copied material from Internet sites, etc.) much faster and easier.

Important note

Double hard rerturns are retained since presumably they are used as paragraph separators -- and in fact they must exist between paragraphs for the macro to work properly. If they don't exist before playing the macro, the selected text will become a single, run together paragraph.

Screen shots

•  sample text BEFORE playing LineWrap

•  sample text AFTER selecting that text and then playing LineWrap


To later remove multiple adjacent hard returns separating paragraphs so that only single hard returns remain see the DelExtraHR.wcm macro here. You should play it after using LineWrap -- but this works best for paragraphs that already have first line indentation (i.e., using tabs, indents, etc., or by using Format, Paragraph, Format, "First line indent").


(1) Just select the sentences or paragraphs (or the entire file, with Edit, Select, All) that you want to strip of intra-paragraph hard returns, and then -

(2) play the macro to "fix up" the file and allow the lines to wrap at the margin.

Operation (for the curious)

LineWrap does its work by opening a new document window and pasting your selection into it. Then it temporarily converts each paragraph (i.e., text ending with 2 hard returns) in the selection into a new page (which is just a format code, not a real page), strips out all hard returns on all pages, then converts the new document back into continuous paragraphs -- but without all those pesky single hard returns embedded in them. Finally, it pastes the newly stripped text back into your original document and closes the temporary window.

A cautionary note (for everyone)

As noted above, converting multiple adjacent paragraphs requires that all the paragraphs be separated by two or more hard returns. You may have to edit the document to ensure this is true before using LineWrap.

If the paragraphs are separated by a single hard return, you could use Find and Replace, and try searching for periods followed by hard return codes (.[HRt]), then replace them with a period plus two hard return codes (.[HRt][HRt]). Then select the paragraphs and play LineWrap.

Related macro