0

W:LastRenderedPageBreak tag missing when document.xml extracted through Office.js. please let me know is there a way to get this tag through Office.js.

Thank you in advance!

Manohar
  • 31
  • 1
  • 6
  • Did you test this on a previously saved, longer Word document that does include `w:lastRenderedPageBreak` elements (meaning you verified this by looking at the Open XML markup)? I can confirm that those elements have gotten in the way of XML transformations which did not expect them more than once. I am not sure whether Microsoft filters those elements in Office.js. The Open XML SDK does not do this for sure. – Thomas Barnekow Feb 24 '20 at 18:44

1 Answers1

0

This tag is "ephemeral". Word may or may not create it in the Word Open XML when the document is closed - one cannot rely on it being present in the closed file.

When the document is opened in Word again, there's no need for the tag as Word will immediately recalculate line and page breaks. It does this dynamically the entire time a document is opened for editing.

So it's not possible to get this tag in a document opened in Word.

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43
  • Thanks @Cindy Meister, But, we see this tag all the time when we load it through VSTO interop objects. This issue is only when it is loaded through Office.js – Manohar Feb 17 '20 at 11:52