Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Using Sequential Document Serial Numbers.

Using Sequential Document Serial Numbers

by Allen Wyatt
(last updated June 26, 2018)


If you have a need to create serial numbers in your documents and they are very simple in nature, you can do so using a macro. This approach to serial numbers is great if your serial numbers are sequential (1, 2, 3, etc.) or regular in their incidence (3, 5, 7, etc.).

To begin, you should enter the macro that will control the change of the serial number and the printing of your document. You can use the following macro:

Sub MySerial()
    Dim rngSerialLocation As Range
    Dim intSerialNum As Integer
    Dim strSerialNum As String
    Dim docCurrent As Document
    Dim intNumCopies As Integer
    Dim intCount As Integer

    ' set ref to current active doc
    Set docCurrent = Application.ActiveDocument
    ' set ref to the bookmarked serial number
    Set rngSerialLocation = docCurrent.Bookmarks("Serial").Range

    ' get the starting number
    intSerialNum = Val(rngSerialLocation.Text)
    ' get the number of copies required
    intNumCopies = Val(InputBox$("How many Copies?", _
      "Print Serialized", "1"))

    For intCount = 1 To intNumCopies
        ' print the document
        docCurrent.PrintOut Range:=wdPrintAllDocument
        ' increment the serial number
        intSerialNum = intSerialNum + 1
        ' put into formatted version
        strSerialNum = Format(intSerialNum, "00000")
        ' stuff into proper place
        rngSerialLocation.Text = strSerialNum
    Next intCount

    ' reset the bookmark, since the updating procedure
    ' wipes out the old one
    docCurrent.Bookmarks.Add Name:="Serial", _
End Sub

There is only one prerequisite to using the macro: you need to make sure that your document contains a bookmark named Serial. This bookmark should reference the serial number in your document, as you want it to appear in the first printed document. (When you are through running the macro, you can save the document and the serial number will be ready for the next time you want to use it.)

The macro also assumes that your serial number consists primarily of some numeric value that changes with each iteration. You can modify the incrementing of the serial number, as well as its formatting, in the For...Next loop within the macro.


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 (1747) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Using Sequential Document Serial Numbers.

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


Jumping to the End of a Word

Using shortcut keys to navigate through your document is really handy. One navigation shortcut that Word doesn't provide ...

Discover More

Controlling Display of Page Breaks

Do you want page breaks displayed on the screen? Excel allows you to specify whether it should show those page breaks or not.

Discover More

Splitting Cells by Case

Excel provides several different ways that you can split apart the contents of a cell. One way it doesn't provide is to ...

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 (menu)

Selecting a Paper Size

Most of the time we print on whatever is a standard paper size for our area, such as letter size or A4 paper. However, ...

Discover More

Adding One More Line

It always seems to happen—you print a document and then discover that you should have included one more line of ...

Discover More

Printing Documents without Markup

If you have a document with Track Changes turned on, you can accumulate quite a bit of "markup" in it. Here's how you can ...

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 3 + 2?

2018-09-26 04:18:49

Rahul Kumar


2017-10-31 16:11:37

John Jackson

Every time I run this I get 3 copies of each iteration. At first I got 2. It was when I deleted the Macro and tried to make it again that it started making 3. When I made a new document and remade the Macro it continued to print 3 copies of each iteration. How do I make it only print one copy of each iteration.

Is there something in a preferences or settings not in the macro that could be causing this issue for myself and evidently others?

2016-09-26 09:44:36

Marshall Burke

Works great except for the automated printing output. Thank you. But how can I modify the macro code so that when I run the macro and increase the count by one, a copy of the previous numbered document is not printed. I do not want an automated printed copy and want to control that printing function in the normal way. I do want the serial number to increase by 1 when the macro is run.

2016-08-01 15:54:26


Hi and thanks for the Tip.
Very interesting.
Is there a way to output all documents in a unique Pdf files please?

Thanks and Regards

2016-03-09 09:14:35


Works awesome. Thanks.

2015-07-07 14:39:18


Oh -- and Thank you Allen!

2015-07-07 14:37:39


Hello everyone! This Macro seemed to work for me except for the fact that the macro is printing 2 copies of each iteration of the document I added the Macro to. I looked through the Macro to see if I could identify a line that was causing the duplication, but did not notice anything I could put my finger on.

Could this be because I am trying this on a multiple pages document? Has this happened to anyone else? If so, how did you fix this issue? Thanks!

Steve - Are you running the Macro to print the document or doing File- Print as you normally would? Running the Macro to print worked for me, except for the issue I mentioned in the paragraph above. (I'm noticing that your comment was posted in March-so perhaps this feedback is a tad bit untimely)

2015-06-11 03:39:09


Awesome, when I run the macro, I get very nice result! thanks a lot!

I bookmarked a text as: Serial

as you have told.

Very Nice!

2015-03-18 17:07:01


Try as I might, I cannot get the serial number to increment.

It may be the sequence and process for a) adding the macro and b) adding the bookmark.

A bookmark named Serial has been added. A single bracketed digit appears at the bottom right of the single page document: [1]

When opened, VB shows one macro named MySerial, flagged as (General).

The number prints, without the brackets, but does NOT increment. Could sure use this sometime today/tonight.


2015-03-06 18:36:41


We have been using this for a couple years when it suddenly stopped working and giving us an over flow error.

Figured out we had reached the limit of the Integer setting of -32,767 to 32,767 when our sequence reached 32767. Changed the dim listings from "Integer" to "Long" and all is good again.

Greatly appreciate this macro and the time it has saved us.

2013-02-13 16:08:21

John K

This macro is exactly what I was looking for. However, is it possible to execute the macro when a users attempts to Click on File>Print or clicks the printer icon?

2012-09-19 16:57:17

Roy Jensen

A workaround: put the serial number in the header or footer. This doesn't work if you have a different first page or non-continuous headers between sections.

2012-09-19 00:31:29

Roy Jensen

I've got this to work, but I would like to print the serial number on EVERY PAGE of the document.

* I've tried referencing the bookmark, but that doesn't work.
* I've tried bookmarking the entire serial number, but that doesn't work.

Any ideas how to do this?


2012-09-05 08:12:15


Hi Alan,
I managed to get help on this forum, you can read the whole thing here:

but if you only need the final result I can send it to you if you post your email address here (in the text area) making sure that you're using some dummy characters instead of "@" something like allan{at}, this way spam sending email address harvesting robots won't see it as an email address.

2012-09-04 20:04:29


Hi Geza, I'm starting off too. I figured out that on the main document you need to click the "Bookmark" icon on the "insert" tab (Word2010). It will ask you a prompt word. You just type in the word "serial" then run it. Just remember to place the curser where you want the serial number to be placed before you bookmark it.

My issue is that it does not request the starting number, it just goes to how many copies...still trying to figure that out.

2012-05-16 08:01:12


I get an Run-time error '5941':
The requested member of the collection doesn't exist.

Set rngSerialLocation = docCurrent.Bookmarks("Serial").Range

Can you help?

This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon 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.