Creating a Lorem Ipsum Tool

by Allen Wyatt
(last updated June 26, 2018)


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. ...


Determining the Number of Bookmarks Defined in a Document

If you develop a macro that needs to work with bookmarks defined in a document, it is inevitable that you will need a way ...

Discover More

Understanding Cell Indenting

Formatting a cell could, if you desire, also include the indentation of information within the cell. This tip examines ...

Discover More

Printing Documents in a Folder

If you want to print a group of documents at the same time there are a couple of ways you can accomplish the task. Here ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Creating Many Index Entries at Once

Word makes it fairly easy to create an index. It is creating the index entries that can be tedious, especially if you ...

Discover More

Creating a Master Document Using Existing Subdocuments

If you decide to create a master document, it is easy to do by just adding one or more subdocuments to an existing ...

Discover More

Setting a Default for the Object Browser

Does it bother you that when you press Ctrl+Page Up or Ctrl+Page Down you aren't always taken to the top of the previous ...

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}] 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 four less than 5?

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.