There are two methods I have found to achieve this goal, I will leave the second method, but I don't use it since it required a separate text file outside the document. Method 1 stores the number in a custom document property.
The idea is I have a single page document and each time it prints should have a unique incrementing number so I can track say, I have doc # 45 to employee John Smith.
I would reccomend reading through Create Simple Greeting Macro - Word - Microsoft Office if you are new to Macros.
Also, you will want to have this automated once it works as expected via this post >> Run Macro Before Printing - Word - Microsoft Office
Here is my final product which is "portable" for you to explore:
- First create a "Custom Document Property" named "Counter" and set the initial value to 0 (or whatever).
- Insert into document where you want it to be when printed (See Link for instructions)
- Press Alt+F11 to open VBA Editor and create new Module
Now I modified my "EventClassModule" to automatically call this sub when printing:
You need to create a module inside word and a txt file containing the current incremental number.
I like to call the txt file the document name and store in the same location.
I am working on automating this process (see Method 1!) (See https://stackoverflow.com/questions/50769735/improving-vba-macro-in-word-to-automatically-create-file-relating-to-document-na/50772002#50772002)
Inside Word Document where you want to place the Serial Number: