Page 1 of 1

Editing Sdt Content problem

PostPosted: Wed Jun 28, 2023 10:05 pm
by Michael
I have a template of a docx document and using docx4j I would like to change the content of "Sdt Content". The "Sdt Block" contains the title of the document from the MS Word "Document Info" field, which is displayed in the header and on the first page.
Unfortunately, when I try to change the <w:t> value in <w:sdtContent> in the XML header file, the value does not update in the generated document. Editing other <w:t> elements without "Sdt Block" works fine for me.
I would like to ask how can I update the text in "Std Content"?
How are these header and first page fields with title related to each other in the source files (they always display the same values)?

Best regards

Re: Editing Sdt Content problem

PostPosted: Fri Jun 30, 2023 10:23 pm
by jason
See answer at https://stackoverflow.com/questions/765 ... j/76588467

And please don't cross post. I'll see your question whether it is here or there, and it just makes extra work for me if you post in 2 places.

Re: Editing Sdt Content problem

PostPosted: Tue Jul 04, 2023 9:29 pm
by Michael
Thanks for the answer on stackoverflow that solved my problem.