I create new word document using DocumentFormat.OpenXml. I load template document in which located the table of content and the table with picture logo. I append other content using c# code for this template. I send this document to user.
When user get this document and open it - the table of contents not update. I found the resolve this problem. I add to my code
- mainPart.DocumentSettingsPart.Settings.Append(new UpdateFieldsOnOpen() { Val = true });
But when user will get the document and will open it he get the message from MS Word "You wanna update fields?".
Is there any other way to generate table of contents or update table of contents without any message to user?