Inserting a Dynamic Line Count

Written by Allen Wyatt (last updated January 4, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


Barry can use fields to insert document information such as the number of characters, words, and pages in a document. He wonders if there is a field (or some other way) to dynamically insert the number of lines in a document.

All of the document information cited by Barry (characters, words, and pages) are inserted into a document using fields. These fields are dynamic in that they can be updated in various ways and at various times. (The way fields are updated has been covered in numerous other WordTips.)

To answer Barry's question directly, it is possible to insert the number of lines into your document using a field. Here's how:

  1. Position the insertion point where you want to insert the value of the custom property.
  2. Make sure the Insert tab of the ribbon is displayed.
  3. Click the Quick Parts tool in the Text group. You'll see a list of options.
  4. Choose Field. Word displays the Field dialog box. (See Figure 1.)
  5. Figure 1. The Field dialog box.

  6. In the list of Categories, choose Document Information.
  7. In the list of Field Names, choose DocProperty.
  8. In the Property list, scroll down and choose the Lines option.
  9. Click on OK. Word inserts the number of lines in your document.

You should understand that there can be lots of "fudge factor" when it comes to counting lines in a document. The reason for this has to do with the content of your document and how you have it formatted. Greg Maxey provides a great discussion (and some solutions) about line count issues at his website:

https://gregmaxey.com/word_tip_pages/count_lines_of_text.html

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

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

Sheets for Days

Need a quick way to have a worksheet for each day in a month? Here's a macro that makes the worksheet creation a snap.

Discover More

Cannot Combine Two Tables

When working with tables, a common editing task is to combine two tables into one. Sometimes, though, you may run into ...

Discover More

Capitalizing the First Letter after a Colon

There are many rules in English grammar (and many exceptions to those rules.) One common rule of grammar is to capitalize ...

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)

Displaying Spaces in a Document

Seeing where every space is within a document can be very helpful in polishing your editing. Here's how to make those ...

Discover More

Entering a Degree Sign

One of the more common symbols that people need to use in their writing is the degree symbol, typically used after a ...

Discover More

Not Selecting Images when Selecting Text

When selecting text in a document that contains images, it is important to understand the relationship of those images ...

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}] (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 eight more than 3?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


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.

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