Setting Maximum Line Lengths in Word E-mail Messages

Written by Allen Wyatt (last updated September 19, 2020)
This tip applies to Word 97, 2000, 2002, and 2003


Subscriber Reyzl Kalifowicz-Waletzky asked if there was a way, when using Word as an e-mail editor, to force line lengths so that they are no longer than 78 characters. Before responding, a little bit of a philosophical discussion may be in order...

There are two types of e-mail that are routinely sent over the Internet. The first type is text-only e-mail. This is the traditional type of e-mail, and text can be displayed by every e-mail client on the planet. If you are working with software (such as a mailing list manager) that expects each line of a message to have only a certain number of characters, it is a safe bet that it is expecting a text-only e-mail message.

The other type of e-mail people send is HTML e-mail. If you get messages that have pretty backgrounds, waving flags, different size type, and attributes such as bold or italic, then the message is an HTML e-mail. Even if the message only contains text, it is still an HTML e-mail. These types of messages use the same formatting codes that exist in Web pages in order to control how text appears in an e-mail client.

The problem is that not all e-mail clients can display HTML e-mail. If they can't display it, chances are they can't see your message. (This, again, is why some programs--such as a mailing list manager--may require text-only messages.) In addition, HTML e-mail messages are always larger than an equivalent text-only message because of the additional formatting information that is sent with the message.

Word, when used as an e-mail editor, is primarily used to create HTML messages. Unfortunately, there is no setting within Word that controls line length, because line length is not an issue with HTML messages. For this reason, if you need to create text-only e-mail messages, it is advisable to do so using a program designed specifically for that purpose. Most e-mail clients (including Outlook, Outlook Express, and Eudora) will create text-only e-mail messages just great. They will even allow you to specify a maximum line length.

If you must use Word as your e-mail client, then there are a couple of things you can do to approach the problem. One approach is to use a monospace font, set the margins so that there are a maximum of 78 characters per line, and then save the file using the Text Only With Line Breaks format. (If you are using Word 2002 or Word 2003, you should save the file using the MS-DOS Text With Layout format.)

Of course, following these steps gets you a file with the proper line length, but not an e-mail message with the proper line length. You would still need to find a way to get the file sent as an e-mail message. For instance, you could load the saved file back into Word and then send it.

Another approach you can use is to create a macro to split lines at the desired line length. The reason for the macro is that you must count actual characters on each line and then place a carriage return at or before the desired length. To complicate matters, the macro needs to make sure that it only breaks lines at the occurrence of a space. Fortunately, VBA allows you to examine words within a document, which automatically breaks at spaces. The following macro will break up a document into the desired line length.

Sub ForceTo78()
    Const cstrPunct As String = "!%*)}]:;>,."
    Dim rngChar As Range

    For Each rngChar In ActiveDocument.Words
        If rngChar.Information(wdFirstCharacterColumnNumber) > 77 Then
            If InStr(1, cstrPunct, Left(rngChar, 1), _
              vbTextCompare) = 0 Then rngChar.InsertParagraphBefore
        End If
    Next rngChar
End Sub

Notice that this macro breaks anything that is over 77 characters. The reason for this is quite simple: VBA, when it examines "words" in a document, considers a break to occur between a character and trailing punctuation. This macro simply examines the words returned, and if they begin with a punctuation mark, it ignores the word.

The bottom line is that the macro will correctly handle paragraphs in which a single punctuation mark appears at the 78th character position. However, if a valid word begins with a punctuation mark ( as in ".com") and that word falls at the 78th character position, then the macro will still ignore the word and allow it to stay on the line. This could, in rare instances, cause a line that is longer than 78 characters.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1572) applies to Microsoft Word 97, 2000, 2002, and 2003.

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

Using AutoCorrect to Start Macros

As you are typing, AutoCorrect provides a "check" that what you are entering doesn't match some pre-defined error ...

Discover More

Understanding Ascending and Descending Sorts

When you sort information, Excel follows a set pattern of how your data is organized. This tip illuminates the burning ...

Discover More

Calculating Dates with Fields

Can you calculate dates using fields? Yes, but you probably don't want to except as a learning experience. An easier way ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Getting Rid of 'Mail To:' in E-mail Links

If you convert e-mail addresses to hyperlinks, you could end up with some 'mailto:' verbiage at the beginning of the ...

Discover More

Embedding TrueType Fonts in E-mails Composed in Word

When you use Word as your e-mail editor, it allows you to format the text of your e-mail messages using tools you are ...

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}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. 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 five more than 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.

Videos
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.