Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Breaking Lines in E-mail.

Breaking Lines in E-mail

by Allen Wyatt
(last updated May 12, 2015)

1

Most e-mail client programs—especially those that use plain text instead of HTML—automatically "break" each line of e-mail at 70 or 72 characters. Fortunately, they do not typically break a line in the middle of a word, but do so at the beginning of the word that reaches the 70- or 72-character mark.

Unfortunately, this can have some adverse effects on e-mail you compose in Word. Some of your lines, when viewed by your recipient, can look strange, breaking at less-than-optimal places and generally looking pretty funky. The solution, of course, is for you to break each line when the appropriate place on the line is reached. This way you can control, ahead of time, how your recipient sees your message.

You can do this manually, if desired, by setting your message margins such that there is only 7 or 7.2 inches of space horizontally. You would then use a 12-point monospace font, such as Courier, to type the message. When a word wraps to the next line, simply backspace to the beginning of the word and press the Enter key.

This could get VERY old VERY fast, even if you send only a moderate amount of e-mail. The better solution is to allow Word to do the breaks for you, yet there does not seem to be such a capability in Word. (You can set up your options in Outlook or Outlook Express to automatically break lines for you, but that doesn't give you as fine a control as doing it directly within Word.)

This brings us to macro territory. You can use the following macro to inspect the current document and automatically "chop up" each paragraph so that no line is over 70 characters in length.

Sub ChopItUp()
    Dim DocThis As Document, docThat As Document
    Dim sParRaw As String
    Dim iParCount As Integer, iParOut As Integer
    Dim J As Long, X As Integer
    Dim iLineWidth As Integer
    Dim sLeft As String, sRight As String
    Dim sTemp As String

    iLineWidth = 70

    Set DocThis = ActiveDocument
    Documents.Add
    Set docThat = ActiveDocument
    DocThis.Activate

    iParCount = DocThis.Paragraphs.Count
    iParOut = 0
    For J = 1 To iParCount
        sParRaw = DocThis.Paragraphs(J).Range.Text
        If Right(sParRaw, 1) = Chr(13) Then
            sParRaw = Left(sParRaw, Len(sParRaw) - 1)
        End If

        sRight = sParRaw
        If Len(sRight) > iLineWidth Then
            While Len(sRight) > iLineWidth
                sLeft = Left(sRight, iLineWidth)
                sRight = Mid(sRight, iLineWidth + 1)
                flgDoIt = True
                If Left(sRight, 1) = " " Then
                    sRight = Mid(sRight, 2)
                    flgDoIt = False
                End If
                If Right(sLeft, 1) = " " Then
                    sLeft = Left(sLeft, Len(sLeft) - 1)
                    flgDoIt = False
                End If

                If flgDoIt Then
                    X = InStr(LTrim(sLeft), " ")
                    If X > 0 Then
                        sTemp = ""
                        While Right(sLeft, 1) <> " "
                            sTemp = Right(sLeft, 1) & sTemp
                            sLeft = Left(sLeft, Len(sLeft) - 1)
                            If Len(sLeft) = 0 Then
                                sLeft = sTemp & " "
                                sTemp = ""
                            End If
                        Wend
                        sRight = sTemp & sRight
                    End If
                    sLeft = Trim(sLeft)
                End If

                docThat.Paragraphs.Add
                docThat.Paragraphs(docThat.Paragraphs.Count).Range = sLeft
                sLeft = ""
                sRight = Trim(sRight)
            Wend
        End If
        docThat.Paragraphs.Add
        docThat.Paragraphs(docThat.Paragraphs.Count).Range = sRight
    Next J
End Sub

When you run this macro, it opens a brand new document and copies the information from the old document to it, making sure that each line is no longer than 70 characters. The new document will not contain any formatting. (Since you are putting together plain-text e-mail, this should not be a problem.) If you want a different line width, all you need to do is change the value assigned to iLineWidth in the macro.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1336) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Breaking Lines in E-mail.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Shortcut for Full-Screen Mode

Want to get rid of almost everything on the screen except your document? Here's how to easily maximize what you see.

Discover More

Getting Input from a Text File

You can use a macro to read information from a text file. The steps are easy, and then you can use that information in any ...

Discover More

Referencing a Worksheet Name

Excel provides ways to reference the column or row number of a cell, but it doesn't provide a built-in way to reference a ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Using a Macro to Change the Formatting of All Instances of a Word

If you have a word that you need to make sure is formatted the same way throughout your document, there are several ways you ...

Discover More

Quickly Formatting Multiple Documents

Need to format a bunch of documents so they all look the same? If the documents use styles, doing the formatting is ...

Discover More

Finding Missing Fonts

When you open documents that were created a long time ago on a system far, far away (sounds almost epic, doesn't it?), you ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 8Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 5?

2015-11-24 07:23:20

Thomas

changing 3 lines like shown below, I use this great code to select a text area and get this text formatted to line size 70 in a new window.

' Dim DocThis As Document
Dim DocThis As Range
Dim docThat As Document
Dim sParRaw As String
Dim iParCount As Integer, iParOut As Integer
Dim J As Long, X As Integer
Dim iLineWidth As Integer
Dim sLeft As String, sRight As String
Dim sTemp As String

iLineWidth = 70

' Set DocThis = ActiveDocument
Set DocThis = Selection.Range
Documents.Add
Set docThat = ActiveDocument
' DocThis.Activate


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.