Removing Unwanted Paragraph Marks from a Text File

Last reviewed: July 30, 1997
Article ID: Q59454
The information in this article applies to:
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a, 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0

SYMPTOMS

When importing a text file into Word, the file may have a paragraph mark at the end of each line. If you want the lines to wrap automatically, you must remove the appropriate paragraph marks.

RESOLUTION

Word 6.0

Word version 6.0 includes a feature to replace paragraph marks at the end of each line. To use this feature from the Format menu select AutoFormat and choose Options. In the Adjust dialog box, select the Paragraph Marks check box.

Word 1.x, 2.x, 6.x, 7.0

You can create a macro to automate this process with Macro Record by doing the following. This procedure assumes that there is a blank line between paragraphs.

  1. Move the cursor to the beginning of the document or select the specific text.

  2. Choose Edit Replace. In the Search For field, type "^p^p" (without the quotation marks). This indicates two consecutive paragraph marks for the search field. In the Replace With field, type "$$$" or another set of unique characters. These characters will mark the end of each paragraph. Uncheck Confirm Changes and choose OK.

  3. Choose Edit Replace. In the Search For field, type "^p". The Replace With field can be left blank or you can enter a space with the SPACEBAR, depending on your document's format. Uncheck Confirm Changes and choose OK.

  4. Choose Edit Replace. In the Search For field, type "$$$" and in Replace With, type "^p^p". Uncheck Confirm Changes and choose OK. The two consecutive paragraph marks will now be restored.

Kbcategory: kbusage kbmacro KBSubcategory:


Additional query words: 1.x 2.0 2.0a 2.0a-CD 7.0 word95 winword
word7 word6 winword 2.0b 2.0c Strip carriage return winword2 how

Version : 1.x 2.x 6.0 6.0a 6.0c 7.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.