How can I connect the the header with the corresponding Chapter Context?

test2.docx (867.3 KB)
here is my test file.
how can i use code to combine the header with the chapter context ?


like this, when I change the content of the chapter, I wish the header (of the whole chapter) can be changed according to it. Is this possible ?

@Madecho You can use bookmark and REF field to achieve this. Your title text should be bookmarked and in the document header you should insert REF field to the corresponding bookmark. For example see the following document example:
example.docx (16.9 KB)

You should note that REF field must be updated after changing the document title. Press Alt+F9 to see field codes.