简体   繁体   中英

Is there any method available in Office JS to close the word document?

We are trying to open new document into current word instance using context.document.body.clear() and then insertFileFromBase64(base64, “Replace”), but if track changes are enabled in word then old contents are showing as redlines with strikethrough. So to solve this we have used createDocument(base64) and document.open() function to open new word instance. But we also want to close existing word instance. So how we will close existing word instance after opening new word instance. Do Office JS provides functionality to close existing word instance.

Example: document.close()

Is there any plan to provide this kind of functionality?

we are trying to provide a close() API but so far it's not available. For your case, I think you can use document.changeTrackingMode to first turn off the track change mode and turn it on later after insertFileFromBase64() if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM