View Single Post
 
Old 06-30-2020, 08:02 AM
Charles Kenyon Charles Kenyon is offline Windows 10 Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

First, stop messing with the header. Use the StyleRef Field instead. That is what it is designed to do.

Second, consider using AutoMatic Numbering tied to your Heading 1 or another style.
How to create numbered headings or outline numbering in Ribbon Versions of Word by Shauna Kelly
If you want to add a chapter heading, apply the style. If you add in the middle, it automatically updates everything after.

This also gives you a good start on your Table of Contents.
Generating a Table of Contents
Why use Microsoft Word’s built-in heading styles? by Shauna Kelly

If you really, really, want to do this the hard way, you could save your number as a custom document property.
How to use a single VBA procedure to read or write both custom and
built-in Document Properties


To me, is seems like you are trying to re-invent the wheel. This stuff is built into Word.
Reply With Quote