Word 6.0 Line Wrapping Not Retained in Text Editor

Last reviewed: February 6, 1998
Article ID: Q108451
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c

SYMPTOMS

Word-wrapped text that you copy from Word for Windows may paste into a text-based application, such as Windows Notepad or an electronic mail (email) text editor, without carriage returns at the end of each line. This causes the text to appear on a single long line in the text editor.

By contrast, wrapped text copied from Word version 2.x for Windows pastes into a text-based application with carriage returns at the end of each line.

CAUSE

By design, Word 6.0 does not include carriage returns at the end of word- wrapped lines in order to comply with OLE (object linking and embedding) version 2.0 specifications. Use the macro in the "Workaround" section below, to add carriage returns to word-wrapped Word 6.0 text.

WORKAROUND

When you copy text from Word and paste it into a text-based application such as your email editor, you may want to maintain the word wrapping as it appeared in Word. You can retain the word wrapping as it appears in Word 6.0 using the macro below, which does the following:

  1. Cuts the selection, with paragraph formatting intact, and places it on the Windows Clipboard (the macro later restores the selection to its original position).

  2. Opens a new document into which it pastes the selection.

  3. Saves the new document to the TEMP directory in Text Only With Line Breaks file format, then closes the file.

  4. Reopens the Text Only file, which now contains a paragraph mark at the end of each line.

  5. Selects and copies the entire document.

  6. Saves the file again (this removes the pointers to the Windows Clipboard, which makes it possible to delete the file).

  7. Closes and deletes the file.

Macro Text

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Sub MAIN
If SelType() = 1 Or SelType() = 5 Then
   MsgBox "There must be a selection for this macro to run."
Else
   ScreenUpdating 0
   Print "One moment please..."
   EditCut
   ParaDown 1, 1
   CopyFormat
   EditUndo
   FileNewDefault
   EditPaste
   EndOfDocument
   PasteFormat
   TmpName$ = Environ$("TEMP") + "\removeme.tmp"
   FileSaveAs .Name = TmpName$, .Format = 5, .AddToMru = 0
   DocClose 2
   FileOpen .Name = TmpName$
   EditSelectAll
   EditCopy
   FileSave
   DocClose
   Print "The text has been copied to the Windows Clipboard."
   Kill  TmpName$
   ScreenUpdating 1
End If
End Sub


KBCategory: kbmacro
KBSubcategory: kbformat
Additional query words: 6.0 ascii ansi DOS editor e-mail winword
word6 6.0a 6.0c
Keywords : kbformat kbole kbmacro
Version : 6.0 6.0a 6.0c
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: February 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.