[WordJS API] Document.saved returns false for any opened document RRS feed

  • Question

  • Running code that checks for the document's `saved` property returns false for a just opened document, which makes no sense.

    export const isSaved  = async (component) => {	
      return context => {
        const thisDocument = context.document;
        context.load(thisDocument, 'saved');
        await context.sync();
        const newHash = saveAndChangeHash(component.state, thisDocument.saved);
        component.setState({...component.state, ...newHash});

    This code works just fine on Word online. However, once loaded into local Word application, the result for document.saved changes to false by default. What gives?

    Sunday, September 8, 2019 3:21 AM

All replies