Visual Basic for Applications/Generate Random Dictionary Words

Summary
This VBA code module works only in MS Word. It generates a pseudo random list of dictionary words, listing them in the immediate window of the VBA editor.

The VBA Code

 * Copy the code listing into a standard VBA module in MS Word and save the file as a docm type. Set the user options in the top section and run the procedure to produce the list.
 * The variable Num sets the number of words as output, and the variable TypoLen should be set to the approximate length of the sought-after words.
 * There is no ready-made collection of English words called a Dictionary in MS Word; the term is used for sets of user-constructed word lists. To access a list of English words, an indirect method needs to be used.  A random word is first generated equal in length to TypoLen.  The spell checker then fails to recognize the word so generates suggestions, this time as a proper collection.   Provided that there is at least one such suggestion in the spell check collection, a random choice is made from among them for the output list.   The loop continues until the chosen number of words has been produced.