Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Inserting a Paragraph from within a Macro.

Inserting a Paragraph from within a Macro

by Allen Wyatt
(last updated April 10, 2018)

4

It is not unusual to use macros to insert new text within a document. One of the common pieces of text you may want to enter is a paragraph mark—the same as when you press Enter within a document. You can do this by using the following code within your VBA macro:

Selection.TypeParagraph

The TypeParagraph method is always used with the Selection object. As was mentioned, using TypeParagraph is the equivalent to pressing Enter in your document. This means that if anything was selected when the command is executed, the selection is replaced by the blank paragraph that the macro inserts.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (10052) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Inserting a Paragraph from within a Macro.

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

MORE FROM ALLEN

Noting Table Rows Containing a Character

If you want to have Word highlight rows in a table that contain a certain character, you need to resort to using a macro. ...

Discover More

Suppressing Endnotes

Endnotes are a beneficial necessity for some documents. If you want to print a copy of the document without endnotes, ...

Discover More

Converting Automatic Numbering to Manual Numbering

The automatic numbering that Word lets you apply to paragraphs in your document can create some great looking content, ...

Discover More

Learning Made Easy! Quickly teach yourself how to format, publish, and share your content using Word 2013. With Step by Step, you set the pace, building and practicing the skills you need, just when you need them! Check out Microsoft Word 2013 Step by Step today!

More WordTips (ribbon)

Determining Differences Between Dates

Do you need to do some simple math using dates in a your macro? One of the easy functions you can use is the DateDiff ...

Discover More

Changing the Format of Existing Dates

There are a myriad of ways in which a date can be formatted—day first, month first, number of digits in the year, ...

Discover More

Determining a Random Value

If you need to determine a random value in a macro, you can do so using the Rnd function. This tip presents the syntax ...

Discover More
Subscribe

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

View most recent newsletter.

Comments

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 five more than 8?

2018-04-10 11:01:27

Mandora

Trevor,

I hear your frustration, however, this is a general Tips site, not specifically a full-blown tutorial site. I have found that writing code to solve a specific problem or need is a great way to learn. Over time skills and insights build. Allen's site is just one of the ways I get informed about ways to solve VBA coding problems. I would recommend taking a basic course in VBA. It will help the "bits and pieces", such as these Tips, fall into place.


2018-04-10 07:42:11

Allen

Trevor,

There are MANY places on this site where I provide tips that use macros. I cannot, in each of those tips, explain HOW to use macros. If I did, it would be quite redundant and would make tips (such as the one above) much less useful for those who already know how to use macros.

That being said, there are a good number of resources I provide that give information on how to use macros. Let's start with what is the most obvious--the FAQ. At the right side of any page on this site (including this page) there is a link that says "WordTips FAQ." If you click that, there is a question there entitled "How Can I Use the Macros In WordTips?" The answer provides some direction, including a link to a tip about how to create macros from scratch.

Second, I provide two different e-books that are helpful in how to use the macros. You can find those here:

https://store.tips.net/T010352_Microsoft_Word_VBA_Guidebook.html
https://store.tips.net/T010057_WordTips_The_Macros.html

Those e-books are available, again, by exploring the "Helpful E-books" link at the bottom of any page.

Third, there is a search box at the upper-right of any page on the site. If you type in the word "macro" you'll get TONS of tips related to macros. You can even, if you desire, look at the Macros category, which is here:

https://wordribbon.tips.net/C0694_Macros.html

Fourth, if you are so inclined, I offer an online course about how to create macros. I don't accept new students all the time; usually about 3 times a year. You can find additional information here:

https://macrosmasterclass.com/

I hope you find this mix of free and non-free resources helpful.

-Allen



2018-04-10 03:43:24

Trevor

You consistently give tips with using Macros but you NEVER show us how to run these macros. This is the last and final time I ask you to do this. I have previously asked you to do this on no fewer than 4 occasions without any response from you. Surely this is not too much to ask!


2014-08-30 05:50:27

Sally

I don't understand any of this - could we have some background explanation please? It supposes we all know all about macros, how to make them and how to use them

Thank you!


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
Subscribe

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.