generating random text

QUICKLY INSERTING SAMPLE TEXT

The =rand() function is perhaps the best example of an "invisible" Word function - it is entirely undocumented in the Microsoft Office Online help file (Help | Microsoft Office Word Help). Believed by some to be an Easter egg (a secretive, harmless or "fun" bonus left in the program by a programmer), it nevertheless has a genuinely useful function that allows you to quickly insert sample text into a document to quickly test formatting techniques.



To try this function out, simply type =rand() in a Word document where you want the text to appear, and then press the "Enter" key. Word will generate some blurb about two new features, Quick Parts and Galleries.

CHANGE THE AMOUNT OF RAND TEXT

By default, the sample text contains three paragraphs, with each paragraph containing five sentences. You can however specify how many paragraphs and sentences you want to appear by adding numbers inside the parentheses in the format =rand(2,3).

The first number is the number of paragraphs.

The second number specifies how many sentences will appear per paragraph. If you omit the second number, you will get five sentences per paragraph by default.

Typing in =rand(2,3) and pressing the "Enter" key will create two paragraphs with three "quick brown fox" sentences in each paragraph.

Typing in =rand(13) and pressing the "Enter" key will create thirteen paragraphs with five sentences in each paragraph.

The maximum number for either parameter is 200 and is said to be lower depending on the number of paragraphs and sentences specified. One of these "upper bounds" is =rand(200,99). That is, if you specify 200 paragraphs, then the maximum number of sentences per paragraph you can specify is 99.

A word of warning: Just because you CAN populate an enormous document with a simple function, doesn't make it good idea. Using smaller numbers like =rand(20,10) should give you a sufficient amount of text to work with, without making your document enormous and unwieldy.

WHY WOULD YOU USE THIS?

It seems like just a little trick with no useful purpose but =rand() has it's moments in the real world.

Use it to fill a page when you're designing a template and want to see how it would look with text in the appropriate places. Some templates need different headers and footers past the first page - =rand() can give you some placeholder text to work with before finalizing the template.

If you're trying to work out text wrapping around an object (eg picture or text box) then =rand() will give you some working text to play with.




Top