I have a Word 2010 template with some bookmarks and styles that I must use to generate a Word document, after getting the information from some XMLs, and I’m using c# with the Interop (version 8.3). The template was given to me and I can’t change it at all, as it follows the documentation rules of the company.
Sometimes, when I use the custom Numbered List style of the template, the numbering screws up, inexplicably starting at 2 instead of 1. Other times, it follows the numbering of the previous list, when I don’t always want that to happen.
Fixing those cases would be easy if I could modify the existing styles from the template, or applying custom styles with ContinuePreviousList: false from my program, but the generated Word document must have the styles they force me to use.
If I open the Word document, right click over the list and choose “Restart at 1” option (I don’t have Word in English, hope that’s the proper translation), it fixes most of the problems that I might have, but I don’t know how to use that from Interop. I have recorded macros and then translated to c# to know how Word makes some functions, but the mouse is locked when I start recording macros. Any ideas?
The mouse is locked, but you can use the right click mouse button on the keyboard to get the context menu, and then select Restart at 1 while recording your Macro.
I ended up with this using C# interop: