Insert a counter in Word
Solved
LG74
-
Lenzini -
Lenzini -
Hello everyone,
I have a Word document which is a manufacturing order. I have its number (14/XXX) and I would like the XXX to be a numeric counter that increments automatically with each print.
I have made several attempts with the automatic insertion but without conclusive results.
I also specify that I have very little knowledge of VB programming.
Thank you in advance.
I have a Word document which is a manufacturing order. I have its number (14/XXX) and I would like the XXX to be a numeric counter that increments automatically with each print.
I have made several attempts with the automatic insertion but without conclusive results.
I also specify that I have very little knowledge of VB programming.
Thank you in advance.
1 answer
-
Hello
You can increment a number with each creation from a template by following this tutorial here
https://faqword.com/index.php/word-faq/vba-solutions/466
--
Argitxu-
Thank you for your quick response.
I tried this tutorial on my document and on a document created for the test.
For the created document, the macro works but the number does not increment.
As for my document, the macro stops at the second line (Num = Num + 1) and gives me "type mismatch."
My document contains mail merge lines; could that be a problem? -
Hello
So we need to start over from the beginning. This is not related to the mail merge
Have you properly created the "number" auto-insertion at the start?
Here is a test template that you can save in your templates for testing
https://www.cjoint.com/?3CluEhwpRyT
Argitxu -
-
-