Accept/Reject Tracked Changes in word document using office js api

72 views Asked by At

I am using office js to track the user changes in the document:

async function setChangeTrackingMode() {
    // Sets the change tracking mode.
    await Word.run(async (context) => {
      context.document.changeTrackingMode = Word.ChangeTrackingMode.trackAll;
      await context.sync();
    });
  }

When i replace/delete some words in the document using paragraph.insertText(), it replaced and got tracked about the changes. But I don't know how to accept/reject the changes programmatically.

I didn't find any resource to help me to accept/reject tracked changes in office js.

1

There are 1 answers