Creating a Lorem Ipsum Tool

by Allen Wyatt
(last updated September 6, 2021)


Charles created a macro to insert lorem ipsum text in a document. He turned on the macro recorder, typed =lorem(), and then pressed Enter. This, of course, inserted the loreem ipsum text. He placed a shortcut to the macro on the Quick Access Toolbar, but the recorded macro only partially works. It types =lorem() for him, but he still needs to manually press Enter. Charles has tried to edit the macro to have it include the Enter command so that when he clicks on the macro shortcut the text gets entered, but to no avail.

If you want your macro to simulate pressing Enter, then you'll need to use the SendKeys command. Chances are good that when you recorded your macro, it looks very similar to this:

Sub Macro1()
' Macro1 Macro
    Selection.TypeText Text:="=lorem()"
End Sub

What you need to do is to replace the last line of the macro (the one just before End Sub) to either of the following:

    SendKeys "~", True
    SendKeys "{ENTER}", False

Either of these lines (you only need one of them) will simulate pressing Enter. There is one gotcha to be aware of, however—SendKeys works in whatever window is currently active. This means you cannot run the macro from within the Visual Basic Editor and get the desired effect. The reason is because when you do that, it is the window in the Editor that is active, so SendKeys "presses Enter" within that window. You should only run the macro when your Word document window is active.

That being said, there is another way you could approach the macro, without using the SendKeys command. All you need to do is to create a new Word document that contains your lorem ipsum text, followed by whatever you want. Name this something unique, such as LoremText.docx. Then, create a macro like this one:

Sub Lorem()
    Selection.InsertFile FileName:="C:\Users\User\Desktop\LoremText.docx"
End Sub

You just need to make sure that the path and filename shown in the macro represents the actual path and filename appropriate for your system. When you run the macro, Word goes out and grabs the LoremText.docx document and inserts it at the insertion point.

Finally, there is another way you could approach this issue without the need of resorting to macros. You could, if desired, insert the lorem ipsum text into your document, select it, and save it as a Building Block or as an AutoCorrect entry. You can then easily insert the text—modified in whatever way you desire—using these Word tools. (How to create and use both Building Blocks and AutoCorrect entries has been covered in other WordTips.)


If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13484) applies to Microsoft Word 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Changing the Number of Headings in an Outline

When viewing a document in Outline view, you have complete control over how much outline detail is shown on-screen. This ...

Discover More

Adding Horizontal Lines at the Sides of a Word

Want to add a couple of horizontal lines at the sides of a word? It can be trickier than it sounds, but there are several ...

Discover More

Duplex by Default

Many printers these days have the capability to print on both sides of a piece of paper. You may want Word to use this ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Mass Search and Replace

If you need to change information in dozens or even hundreds of documents, the task can seem insurmountable. Here's a way ...

Discover More

Auto Creation of an Acronym List

If you use a lot of acronyms in your documents, you may want a quick way to compile those acronyms and their definitions ...

Discover More

Fixing Word

Need to make sure that Word is installed correctly from the original installation CDs? You can do it by using a command ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 9 - 1?

2016-10-25 07:48:41

Ken Endacott

Steve. Many organisations control options in the copy of Word loaded onto workstations so that Macro Settings is not available.

Jenifer. You will win the bet every time because =rand(), =lorem() and =rand.old() generate text that has settings to inhibit spell checking. Try copying part (not whole paragraphs) of the Latin text to elsewhere in the document and spelling errors will be shown. That is unless you have a Latin dictionary loaded.

2016-10-24 10:49:34


Could you skip the whole =rand or =lorem process by adding a "word" to your custom dictionary that swaps in the (lorem) text you want? That would avoid the need to mouse to the icon, and avoid the macro security.

2016-10-24 09:28:31


Paul, I agree with Allen... restricting the use of macros all together only reduces productivity. It is true that people can create harmful macros and can be saved to a document when passed to others via email, etc., but you may have some options. First, its possible that your company simply disables macros by default, which means that you may be able to simple alter the settings for your local copy of Word. Try going to File, then Options, Trust Center, Trust Center Settings, Macro Settings. See how its currently set and if there is a suitable option for you, such as "Disable all macros with notification", or "Disable all macros except digitally signed macros".

2016-10-24 09:11:55

Jennifer Thomas

Use =rand(x,y) for English or =lorem(x,y) for pseudo-Latin.

I particularly like adding the y value of '1' for demonstrating formatting options on sample title or list paragraphs, but that works better with lorem than with rand.

Just a thought for those pondering how to use this tool (other than to win a bet that you can create 5 pages of correctly-spelled text in less than a minute, which earned me 20 reluctantly-given bucks one time - geek-fun at its finest!).

2016-10-24 08:46:08

Paul: That's pretty strict! Using macros is what can make any Office application *MUCH* more productive for individual office needs. Prohibiting them actually hobbles what employees can do for the company.


2016-10-24 06:16:38

Paul Franklin Stregevsky

Everywhere I've worked for the past 15 years, MS Office macros have been prohibited.

2016-10-23 15:09:24

Art Osgatharp

Paul -

Create a macro as described in the article, then add an icon for the macro to your Quick Access toolbar (More Commands...Choose commands from: Macros. Select your macro and click Add).

2016-10-23 06:30:43

Paul Franklin Stregevsky

I can't find a command or shortcut for this feature that I can hang on my Quick Access Toolbar. Anyone?

2016-10-22 21:38:57

Geof Richardson

More on =rand(x)

x= number of paragraphs
y = number sentences per paragraph


2016-10-22 18:41:38

Art Osgatharp

Another way to insert random text is the rand command: =rand(number of paragraphs desired). Typing =rand(10) and pressing Enter will insert 10 paragraphs of readable random text. This can be used in a macro in the same way as the =lorem command.

This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.