
Tips.Net > WordTips Home > Online and Web > Email > Setting Maximum Line Lengths in Word E-mail Messages
Summary: 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 familiar with. One thing that is harder to do, however, is to limit the line length of e-mail messages created with Word. This tip explains why the difficulty arises and what you can do to work through the difficulty. (This tip works with Microsoft Word 97, Word 2000, Word 2002, and Word 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.
Tip #1572 applies to Microsoft Word versions: 97 2000 2002 2003
Take Control! Master the real power behind Word! Successfully master the secrets of powerful formatting and create documents that stand out from the rest. Best of all, you can create documents that are easy to maintain and quick to change.
Check out WordTips: Sytles and Templates today!
If you provide support and help to others, you need the power offered in the WordTips Ten-Year Library. There is no better information repository anywhere! (more information...)
Ask a Word Question
Make a Comment
Beauty Tips
Bugs and Pests Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Organizing Tips
Pet Tips
Word2007 Tips
WordTips