| This macro toggles hierarchical numbering for all paragraphs styled as Heading 1 through Heading 6 on the current page. It intelligently detects existing numeric prefixes using string analysis to determine whether to add or remove numbering.
In Add Mode, it prepends multi-level numbers (e.g., "1", "1.1", "1.1.1", etc.) to your headings while automatically maintaining and resetting sub-level counts. In Remove Mode, it identifies the numeric prefix and strips it away to restore your original heading text. This toggle design allows you to quickly refresh or "reset" your numbering by simply running the macro twice. |
|