|
The rand “virus”: or how to insert dummy text into a documentLike jokes, urban legends, and virus hoaxes, tips about Word’s little-used or undocumented features periodically makes their way around the Internet, occasioning a wave of postings in Word newsgroups. One of these is =rand(), which is sometimes represented as an Easter egg, sometimes feared as a possible virus. It is neither. It is a Word function (undocumented in the online Help but documented in the Microsoft Knowledge Base) that can be useful in certain circumstances. The rand functionA Microsoft Knowledge Base article “How to insert sample text into a document in Word” (no longer available) used to explain the use and syntax of the function: “to quickly insert sample text into a document.” (A new Support article, “How to insert sample text in Microsoft Office Word,” has now been written to replace this.) To do this, type =rand() in the document where you want the text to appear, and then press Enter.
In Word 2003 and earlier (English versions), the inserted text is that hardy perennial: “The quick brown fox jumps over the lazy dog,” which contains every letter in the English alphabet. As the KB article explained, different language versions of Word use different text. In Word 2007 and above, =rand() produces several paragraphs of text telling you useful things about galleries, Quick Styles, and themes. If you want quick brown foxes instead, you can use the syntax =rand.old(). By default, the sample text contains three paragraphs, each containing five sentences (three paragraphs of three sentences in Word 2007 and above). You can control how many paragraphs and sentences appear by adding numbers inside the parentheses, for instance:
The first number is the number of paragraphs, and the second the number of sentences per paragraph. If you omit the second number, you get five sentences in each paragraph. So, for example:
inserts three four-sentence paragraphs, while:
inserts ten paragraphs of three or five sentences. The maximum number for either parameter is 200 and may be lower depending on the number of paragraphs and sentences specified. For instance, if you specify 200 paragraphs, then the maximum number of sentences per paragraph you can specify is 99:
If you specify 200 sentences per paragraph, then the maximum number of paragraphs you can specify is 99. Admittedly, this function serves a useful purpose for filling a page when you’re designing a template and want to see how it will look with text in it. It’s also easy to see how users can be alarmed and fear this is a virus when someone suggests they try “=rand(200,99),” which quickly blows up into a giant document! (Incidentally, part of the instructions in some versions is to “Make sure there is a space between = and rand and a space between rand and (200,99).” This actually makes no difference: the function works equally well with and without spaces.) A better method of creating dummy textAlthough the rand function is quick and easy, the text it produces is not very natural. All the paragraphs are the same length, and, because every sentence is the same, the lines will tend to break in the same places. The result is that some possible formatting problems may be masked. Another, more useful, possibility, therefore, is to use “Greek“ or “lorem ipsum” text. Because this kind of dummy text is very commonly used by designers (because it gives a natural look without distracting content), you’ve probably seen examples of it. Microsoft even used it in the Microsoft TrueType Font Assistant (version 1.1) in Windows 3.x. According to the Microsoft Knowledge Base article “Description of the ‘Lorem ipsum dolor sit amet’ text that appears in Word Help”:
“Although the phrase is nonsense,” the article continues, “it does have a long history.” If you’re curious about that history, follow the link above. Lorem ipsum text is also discussed at The Free Online Dictionary of Computing, which adds that “the point of using this text, or some other text of incidental intelligibility, is that it has a more-or-less normal (for English and Latin, at least) distribution of ascenders, descenders, and word lengths, as opposed to just using ‘abc 123 abc 123’, ‘Content here content here’, or the like.” If you want to use the text, here’s how: Word 2007 and above: Ribbon versions of Word have a built-in function, similar to =rand, that produces this text automatically. Type =lorem() and press Enter. The text entered is not identical to what is given below but is similar. Word 2003 and earlier:
Here’s the text:
One caveat about the above sample: it does not contain every letter in the English alphabet. If it is important for testing purposes that you include every letter, then you are better off with quick brown foxes (or some other pangram). This article copyright © 2001, 2016, 2023 by Suzanne S. Barnhill. |