In a Word document with more than 1 section that has headers set to "Same as Previous", loading a section's header via a Word.run function causes the header content to be deleted inadvertently.
Header content should not be deleted.
Word.run(async context => {
const sections = context.document.sections.load([
'items',
'text',
])
await context.sync()
for (const section of sections.items) {
section.getHeader(Word.HeaderFooterType.primary)
}
return await context.sync()
})
At Medtronic, our add-in needs to read the text of every header in a document, instead this is causing users to think our add-in is modifying their document. Not good!
Bump...
Hi Matt, sorry for the delay on this and thanks for provided detailed information about the issue. @JuaneloJuanelo can you look into this? It appears to be a bug - reading the headers causes some of them to disappear. It's reproducible by following Matt's steps outlined above.
@mattblackdev thanks for reporting this issue, yes effectively this is a bug and we are working on a fix. there are 2 fixes we are planning to have here:
tracking with 2688667
This is fixed!