Share this page 

Generate text in MS WordTag(s): Misc Prog HowTo


Word2003
Open a new document in word and type without a space
=rand(10,1)
and press [ENTER] and Word will generate 10 paragraphs with one sentence in each one.

The output with the french version of Word :

Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis
Servez à ce monsieur une bière et des kiwis

The output for the english version :

The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog
The quick brown fox jumps over the lazy dog

The first parameter is for how many paragraphs you want and the second parameter controls the length of a paragraph.

With Word 2007, the rand function picks random text from the Word help instead. The previous behaviour is still available with the rand.old().

Starting with Word 2007, a new function is available to generate Lorem Ipsum text filler. The function is

=lorem(paragraphs,sentences)
for example
=lorem(2,5)
generates
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa.
Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet
commodo magna eros quis urna. Nunc viverra imperdiet enim. Fusce est.

Vivamus a tellus. Pellentesque habitant morbi tristique senectus et netus et malesuada
fames ac turpis egestas. Proin pharetra nonummy pede. Mauris et orci. Aenean nec lorem.

Another trick is to generate a separator line.

At the beginning of a line, type 3 special characters and a seperator will be inserted. Depending on the characters typed, the style of the seperator will change.

--- Thin line
*** Broken line
### Thick line with two thin lines
=== Double line
~~~ Wavy line
and the result is