Preserve header contents on document's styles updated from template

Any slight adjustment to a template results in previous documents made on the same template gives the message:

The template ‘General_knowledge’ on which this document is based, has been modified. Do you want to update style based formatting according to the modified template?

The button for ‘Update styles’ seems logical so I choose that, only to find text has disappeared from the header. But I had not adjusted the header when I changed the template.

The header is in the ‘Default Style.’

This sounds like you have different setup in previous documents then in template. Do you have header in previous document the same way as in template? Do you have header in previous document but not in the template? Don’t know if header ‘Default style’ is in template or document but does both have header inserted with same styles? What might have happened is that header with content gets replaced with header (style) without content on update.

Describe your slight adjustment so that we can try to reproduce the mishap.

See also here.

Aside: please don’t “answer” questions with something that actually does not answers the asked question (like providing some missing information). Answers are expected to be useful to solve the question. Please either Edit your question (but unfortunately, you made it Wiki for unknown reason), or comments for non-answers.

Thanks for your answer. The headers in the template and the documents are identical. When a new document is opened, I add text in it as the title for the document.

The ‘slight adjustment’ is not in the header. It is in the text in the template. Just changing the wording of a multiple choice question. Then when I open other documents based on the same template I get the ’ Do you want to update style based formatting according to the modified template?’ message and the text (title) in the header has disappeared.

  • The template header contains text: ‘Document 00#’
  • New documents are titled for example ‘Document 005 blah blah blah.’ Saved.
  • Then template is changed. Do not touch in the header.
  • Then when opening that other document there is the ‘Do you want to update’ message, to which I click yes and the document opens with the header reverted to ‘Document 00#’ again.

I can easily upload an example.
Thanks for your patience.

You’ve put content in template’s header, when you update document from template, it will place content from template’s header to document being updated. It’s expected behavior.

Do this in your template:

File → Properties → Custom properties. Click add Property. Name variable ‘DocNum’, choose Number from the drop down, enter ‘1’ in the Value input box.

Now go Insert → Fields → More fields → choose DocNum under Custom. Click Insert.

Now all you need to do in any of your other documents is define ‘DocNum’ under File → Properties → Custom properties. Just place there a number you would like to use with that particular document and everything should work on template update.

But don’t put in template any content that’s specific to one document and you wouldn’t want new template update reverts it. Insetead ‘Document 005 NewDocName’, template should have only ‘Document 005’ and five being a filed that changes dynamically.

You could even in new documents set document title: File → Properties → Description → Title and enter title for that particular document there.

Then insert title filed in your template after: Insert → Filed → Title.

Accept this answer if helped by clicking check mark at top of the answer (left side).

Thanks Kruno for your helpful response. I’ll follow all your useful suggestions.