Creating a counter [modified]
-
I need some help creating an MS-Word counter macro as I'm not well versed in Visual Basic. I am trying to find a repeating XML tag pattern in an MS-Word file as shown below:
<subunit>
any text . . .
</subunit>What I need the macro to do is to attach a number to the tag and each time the tag is found, the number should increment by 1. See my desired output:
<subunit_1>
any text . . .
</subunit_1><subunit_2>
any text . . .
</subunit_2><subunit_3>
any text . . .
</subunit_3>Can such a macro be created in Word? I do have some experience editing macros in the VB editor but very limited. I might add that I already have a macro that duplicates an XML tag each time I run the macro but without the incrementing. Should I try to edit this current macro to get my desired output? Thanks Harold -- modified at 0:05 Wednesday 26th July, 2006