|
|
|
|
|
|
Word
|
Add dummy text to your document
|
|
Ease of Use
|
Easy
|
Version tested with
|
2000, 2002, 2003
|
Submitted by:
|
MOS MASTER
|
Description:
|
This sub will add 10 paragraphs of dummy text to your document.
|
Discussion:
|
Sometimes you need a lot of dummy text to try out a certain procedure. With this method you can add that amount of dummy text that you need.
=Rand() is a special thing in Word to add dummy text.
This is how it works:
=rand(10) creates 10 paragraphs.
=rand(10,3) creates 10 paragraphs with 3 sentences in it.
=rand(10, 7) creates 10 paragraphs with 7 sentences in it.
Read more about it here:
http://support.microsoft.com/?kbid=212251 (Read the part about Replace as you type if you experience problem executing this little sub)
|
Code:
|
instructions for use
|
Option Explicit
Sub RandomText()
Selection.TypeText Text:="=Rand(10)"
SendKeys "~", True
End Sub
|
How to use:
|
- Open your Word document.
- Press Alt + F11 to open VBE.
- Insert-Module. (Insert -> module)
- Paste the code there in the window at right. (F7)
- Close VBE (Alt + Q or press the X in the top right hand corner).
- Save the file.
|
Test the code:
|
- From Word, press Alt + F8 to open the macro dialog box.
- Select RandomText
- Click Run.
|
Sample File:
|
Dummy Text.zip 5.95KB
|
Approved by mdmackillop
|
This entry has been viewed 128 times.
|
|