Search code examples
office365office-jsadd-inoffice-addinsword-addins

OfficeJS word-addin - how to remove deleted text/paragraph from document.paragraphs if track changes is on and all revisions inline


I am working on word add-in and I have the following scenario:

When track changes is on and the changes are displayed inline enter image description here

then moved some text/paragraph to another place enter image description here

at this point the document added the moved paragraph successfully to its items but it does not remove the deleted paragraph, so we have this paragraph twice.

Word.run(context => {
    const { paragraphs } = context.document.body;
    console.log(paragraphs.items) // moved paragraph now in items[2] & items[8]
})

So it there a way to delete the deleted paragraph/text from paragraphs.items if they are deleted? or any workaround? I know there is no way to access track changes in officeJs word ATM.


Solution

  • This is a known issue with the API. The problem will be solved when track changes is supported. Particularly to know that track changes is on, ability to turn it on/off or change the mode.