rand function in MS Word

A popular trick to surprise friends as
  • Open MS-Word
  • type =rand(200,99)
  • then see what happens
Have you tried the same. If not try now.....
It will print a lot of characters and will take about 200-600 pages depending upon the version of MS-Word you have

Some thinks as it is a drawback of MS-Word
For those who think the same, the answer is the one and only one, it is not a drawback of MS-Word as its a feature of MS-Word.
rand function in MS-Word prints a sample text.
Uses of Sample text:-

  • to test various styles
  • to test various formatting
  • to test feature like mail merge and much more...


Now lets start from basic of this function
I think we all know that Microsoft classifies MS-Word in two categories
  • MS Office 2003 or lower
  • MS Office 2007 or higher like MS Office 2010
This feature also depends accordingly on the versions...


What the sample text will be?
The sample text depends on two things
--> version
--> arguments passed through it
Version
In MS-Word 2003 or lower the text will be consist of no. of lines of a line "The quick brown fox jumps over the lazy dog" which contains all alphabets from 'a' to 'z' in a systematic manner.
In MS-Word 2007 or higher version, the text will be consist of  several lines of MS Word help which gives idea about several features of MS-Word like Insert tab, themes and much more
Arguments Passed
We can use rand functions in three different modes
  • With two arguments
  • With one arguments
  • With no argument
The basic syntax of rand function is
=rand(x,y)
where x represents number of paragraphs,
          y represents number of lines per paragraph

  • When we pass rand function with two arguments it will set the length of line as well as paragraph accordingly
  • When we will pass rand function with one argument , the number of paragraphs will be controlled and the lines per paragraph will be default (3 lines per paragraph for MS-Word 2007 version and higher and 5 lines per paragraph for MS-Word 2003 version or lower)
  • When we will pass rand function with no argument both the value of lines per paragraph and no. of paragraph will be taken as default (3 lines per paragraph for MS-Word 2007 version and higher and 5 lines per paragraph for MS-Word 2003 version or lower)
The maximum value of lines per paragraph can be 99
and the maximum number of paragraphs is 200

Because of this when we type =rand(200,99), MS-Word generates about 200-600 pages in less than 2-3 seconds...

2 Response to "rand function in MS Word"

  1. Zealous Engineerz says:
    May 1, 2012 at 11:05 PM

    Leave your comments here

  2. -==dEsI InDiAn==- says:
    May 1, 2012 at 11:17 PM

    cool..nice info dude :)

Post a Comment