Bug with getFileAsync() method on word desktop





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I have an add-in for Word that gets the entire document using the getFileAsync() from the Office Javascript API, converts it into hash, and saves it into a database for future comparison.



Recently, I have encountered an issue related to it where invoking the function on the desktop platform somehow modifies the document. I’ve contacted a support engineer from Microsoft and have identified the issue as a bug. The support engineer submitted this bug by opening an issue in the OfficeDev/office-js repository. Here is the link of the issue: https://github.com/OfficeDev/office-js/issues/298



Upon calling the getFileAsync function on the desktop application, the document seems to change without doing anything else. Here is the code that was used:






verifyDocument(callback){
let method = 'getDocumentByFile'

var promiseGetFileAsync = new Promise((resolve, reject) => {

Office.context.document.getFilePropertiesAsync(function (asyncResult) {
let fileUrl = asyncResult.value.url;
let fileType = localStorage.getItem("Host");

if (!fileUrl) {
reject("Please save the file first")
} else {

Office.context.document.getFileAsync('compressed',
{},
function (result) {

if (result.status == Office.AsyncResultStatus.Succeeded) {

var myFile = result.value;

var state = {
file: myFile,
counter: 0,
sliceCount: myFile.sliceCount
};
state.file.getSliceAsync(state.counter, function (result) {
if (result.status == Office.AsyncResultStatus.Succeeded) {

var slice = result.value;
var data = slice.data;
var payload

if (data) {

payload = {
method : method,
data: data,
fileType: fileType
}
resolve(payload);
}

state.counter++;
if (state.counter > state.sliceCount) {

}
else {
state.file.closeAsync();
}

}

});
}
else {
reject(result.error)
}
});
}
});
})

promiseGetFileAsync.then((data: any) => {

let myHeaders = new Headers();
myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
let options = new RequestOptions({ headers: myHeaders });
var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
let formData: FormData = new FormData();
formData.append('method', data.method);
formData.append('document', file);

this.http.post('Link to our API receiver', formData, options)
.map(res => res.json())
.subscribe(response => {
callback(response);
}
)
});





This code gets the entire document and sends it as a blob to our API receiver for comparison.



The method of comparison among the documents being sent and on the database is through sha256 hash. The API converts the received document into a sha256 hash and compares it to all the hashes on the database. The code also serves as an "update" to the hash that's already on the database, with a different API link that still converts the document into a sha256 hash and puts that certain hash on the database to be compared in the future. This works seamlessly on Word Online; but when opening the document on Word Office 365, it fails. After calling the function, the API cannot find the document's hash on the database and will return an error. This is because the function sends a different document to the receiver. Upon exiting the Word application, we are prompted with the message:



Dialog box



We can conclude with this dialog box that there is something that is changed on the document. Agreeing to save the document and exiting the desktop application will change the document again because it was saved. Opening the document on Word Online and calling the function from there will result to a failed verification upon comparing the document’s hash to the ones on the database.



To make things short, the getFileAsync function behaves differently on the desktop application compared to Word Online because it returns a document with the same contents but with a different metadata.



Does someone know why this happens only on the desktop application and not on Word Online? Are there any workarounds for this issue?



UPDATE:



Apparently, this issue has now been closed by the PM assigned to it while suggesting the getOoxml() method from the Word API as a workaround. I've tried to redo the add-in with the code from the documentation and have found out that the bodyOOXML variable's value also changes upon calling the function.



The PM stated to get the document element from the bodyOOXML and compare it to the existing one on the database; but upon manual inspection, I've found out that the <w:p w:rsidR="00000000" w:rsidRDefault="******"> element has always a different value for w:rsidRDefault after every invocation of the function. This will always lead to a negative result on the comparison. Moreover, I think that the document element from the output only takes the text from the document, excluding the images on it.
Here is the w:document element from the bodyOOXML value:






<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>





Here is the download link of the XML files for a direct comparison.



I am still on a deadlock with what to do on this. The recommendation has a bigger issue since it now even affects Word Online aside from the desktop versions. I hope anyone can help me on this.










share|improve this question































    0















    I have an add-in for Word that gets the entire document using the getFileAsync() from the Office Javascript API, converts it into hash, and saves it into a database for future comparison.



    Recently, I have encountered an issue related to it where invoking the function on the desktop platform somehow modifies the document. I’ve contacted a support engineer from Microsoft and have identified the issue as a bug. The support engineer submitted this bug by opening an issue in the OfficeDev/office-js repository. Here is the link of the issue: https://github.com/OfficeDev/office-js/issues/298



    Upon calling the getFileAsync function on the desktop application, the document seems to change without doing anything else. Here is the code that was used:






    verifyDocument(callback){
    let method = 'getDocumentByFile'

    var promiseGetFileAsync = new Promise((resolve, reject) => {

    Office.context.document.getFilePropertiesAsync(function (asyncResult) {
    let fileUrl = asyncResult.value.url;
    let fileType = localStorage.getItem("Host");

    if (!fileUrl) {
    reject("Please save the file first")
    } else {

    Office.context.document.getFileAsync('compressed',
    {},
    function (result) {

    if (result.status == Office.AsyncResultStatus.Succeeded) {

    var myFile = result.value;

    var state = {
    file: myFile,
    counter: 0,
    sliceCount: myFile.sliceCount
    };
    state.file.getSliceAsync(state.counter, function (result) {
    if (result.status == Office.AsyncResultStatus.Succeeded) {

    var slice = result.value;
    var data = slice.data;
    var payload

    if (data) {

    payload = {
    method : method,
    data: data,
    fileType: fileType
    }
    resolve(payload);
    }

    state.counter++;
    if (state.counter > state.sliceCount) {

    }
    else {
    state.file.closeAsync();
    }

    }

    });
    }
    else {
    reject(result.error)
    }
    });
    }
    });
    })

    promiseGetFileAsync.then((data: any) => {

    let myHeaders = new Headers();
    myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
    let options = new RequestOptions({ headers: myHeaders });
    var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
    let formData: FormData = new FormData();
    formData.append('method', data.method);
    formData.append('document', file);

    this.http.post('Link to our API receiver', formData, options)
    .map(res => res.json())
    .subscribe(response => {
    callback(response);
    }
    )
    });





    This code gets the entire document and sends it as a blob to our API receiver for comparison.



    The method of comparison among the documents being sent and on the database is through sha256 hash. The API converts the received document into a sha256 hash and compares it to all the hashes on the database. The code also serves as an "update" to the hash that's already on the database, with a different API link that still converts the document into a sha256 hash and puts that certain hash on the database to be compared in the future. This works seamlessly on Word Online; but when opening the document on Word Office 365, it fails. After calling the function, the API cannot find the document's hash on the database and will return an error. This is because the function sends a different document to the receiver. Upon exiting the Word application, we are prompted with the message:



    Dialog box



    We can conclude with this dialog box that there is something that is changed on the document. Agreeing to save the document and exiting the desktop application will change the document again because it was saved. Opening the document on Word Online and calling the function from there will result to a failed verification upon comparing the document’s hash to the ones on the database.



    To make things short, the getFileAsync function behaves differently on the desktop application compared to Word Online because it returns a document with the same contents but with a different metadata.



    Does someone know why this happens only on the desktop application and not on Word Online? Are there any workarounds for this issue?



    UPDATE:



    Apparently, this issue has now been closed by the PM assigned to it while suggesting the getOoxml() method from the Word API as a workaround. I've tried to redo the add-in with the code from the documentation and have found out that the bodyOOXML variable's value also changes upon calling the function.



    The PM stated to get the document element from the bodyOOXML and compare it to the existing one on the database; but upon manual inspection, I've found out that the <w:p w:rsidR="00000000" w:rsidRDefault="******"> element has always a different value for w:rsidRDefault after every invocation of the function. This will always lead to a negative result on the comparison. Moreover, I think that the document element from the output only takes the text from the document, excluding the images on it.
    Here is the w:document element from the bodyOOXML value:






    <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>





    Here is the download link of the XML files for a direct comparison.



    I am still on a deadlock with what to do on this. The recommendation has a bigger issue since it now even affects Word Online aside from the desktop versions. I hope anyone can help me on this.










    share|improve this question



























      0












      0








      0








      I have an add-in for Word that gets the entire document using the getFileAsync() from the Office Javascript API, converts it into hash, and saves it into a database for future comparison.



      Recently, I have encountered an issue related to it where invoking the function on the desktop platform somehow modifies the document. I’ve contacted a support engineer from Microsoft and have identified the issue as a bug. The support engineer submitted this bug by opening an issue in the OfficeDev/office-js repository. Here is the link of the issue: https://github.com/OfficeDev/office-js/issues/298



      Upon calling the getFileAsync function on the desktop application, the document seems to change without doing anything else. Here is the code that was used:






      verifyDocument(callback){
      let method = 'getDocumentByFile'

      var promiseGetFileAsync = new Promise((resolve, reject) => {

      Office.context.document.getFilePropertiesAsync(function (asyncResult) {
      let fileUrl = asyncResult.value.url;
      let fileType = localStorage.getItem("Host");

      if (!fileUrl) {
      reject("Please save the file first")
      } else {

      Office.context.document.getFileAsync('compressed',
      {},
      function (result) {

      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var myFile = result.value;

      var state = {
      file: myFile,
      counter: 0,
      sliceCount: myFile.sliceCount
      };
      state.file.getSliceAsync(state.counter, function (result) {
      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var slice = result.value;
      var data = slice.data;
      var payload

      if (data) {

      payload = {
      method : method,
      data: data,
      fileType: fileType
      }
      resolve(payload);
      }

      state.counter++;
      if (state.counter > state.sliceCount) {

      }
      else {
      state.file.closeAsync();
      }

      }

      });
      }
      else {
      reject(result.error)
      }
      });
      }
      });
      })

      promiseGetFileAsync.then((data: any) => {

      let myHeaders = new Headers();
      myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
      let options = new RequestOptions({ headers: myHeaders });
      var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
      let formData: FormData = new FormData();
      formData.append('method', data.method);
      formData.append('document', file);

      this.http.post('Link to our API receiver', formData, options)
      .map(res => res.json())
      .subscribe(response => {
      callback(response);
      }
      )
      });





      This code gets the entire document and sends it as a blob to our API receiver for comparison.



      The method of comparison among the documents being sent and on the database is through sha256 hash. The API converts the received document into a sha256 hash and compares it to all the hashes on the database. The code also serves as an "update" to the hash that's already on the database, with a different API link that still converts the document into a sha256 hash and puts that certain hash on the database to be compared in the future. This works seamlessly on Word Online; but when opening the document on Word Office 365, it fails. After calling the function, the API cannot find the document's hash on the database and will return an error. This is because the function sends a different document to the receiver. Upon exiting the Word application, we are prompted with the message:



      Dialog box



      We can conclude with this dialog box that there is something that is changed on the document. Agreeing to save the document and exiting the desktop application will change the document again because it was saved. Opening the document on Word Online and calling the function from there will result to a failed verification upon comparing the document’s hash to the ones on the database.



      To make things short, the getFileAsync function behaves differently on the desktop application compared to Word Online because it returns a document with the same contents but with a different metadata.



      Does someone know why this happens only on the desktop application and not on Word Online? Are there any workarounds for this issue?



      UPDATE:



      Apparently, this issue has now been closed by the PM assigned to it while suggesting the getOoxml() method from the Word API as a workaround. I've tried to redo the add-in with the code from the documentation and have found out that the bodyOOXML variable's value also changes upon calling the function.



      The PM stated to get the document element from the bodyOOXML and compare it to the existing one on the database; but upon manual inspection, I've found out that the <w:p w:rsidR="00000000" w:rsidRDefault="******"> element has always a different value for w:rsidRDefault after every invocation of the function. This will always lead to a negative result on the comparison. Moreover, I think that the document element from the output only takes the text from the document, excluding the images on it.
      Here is the w:document element from the bodyOOXML value:






      <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>





      Here is the download link of the XML files for a direct comparison.



      I am still on a deadlock with what to do on this. The recommendation has a bigger issue since it now even affects Word Online aside from the desktop versions. I hope anyone can help me on this.










      share|improve this question
















      I have an add-in for Word that gets the entire document using the getFileAsync() from the Office Javascript API, converts it into hash, and saves it into a database for future comparison.



      Recently, I have encountered an issue related to it where invoking the function on the desktop platform somehow modifies the document. I’ve contacted a support engineer from Microsoft and have identified the issue as a bug. The support engineer submitted this bug by opening an issue in the OfficeDev/office-js repository. Here is the link of the issue: https://github.com/OfficeDev/office-js/issues/298



      Upon calling the getFileAsync function on the desktop application, the document seems to change without doing anything else. Here is the code that was used:






      verifyDocument(callback){
      let method = 'getDocumentByFile'

      var promiseGetFileAsync = new Promise((resolve, reject) => {

      Office.context.document.getFilePropertiesAsync(function (asyncResult) {
      let fileUrl = asyncResult.value.url;
      let fileType = localStorage.getItem("Host");

      if (!fileUrl) {
      reject("Please save the file first")
      } else {

      Office.context.document.getFileAsync('compressed',
      {},
      function (result) {

      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var myFile = result.value;

      var state = {
      file: myFile,
      counter: 0,
      sliceCount: myFile.sliceCount
      };
      state.file.getSliceAsync(state.counter, function (result) {
      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var slice = result.value;
      var data = slice.data;
      var payload

      if (data) {

      payload = {
      method : method,
      data: data,
      fileType: fileType
      }
      resolve(payload);
      }

      state.counter++;
      if (state.counter > state.sliceCount) {

      }
      else {
      state.file.closeAsync();
      }

      }

      });
      }
      else {
      reject(result.error)
      }
      });
      }
      });
      })

      promiseGetFileAsync.then((data: any) => {

      let myHeaders = new Headers();
      myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
      let options = new RequestOptions({ headers: myHeaders });
      var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
      let formData: FormData = new FormData();
      formData.append('method', data.method);
      formData.append('document', file);

      this.http.post('Link to our API receiver', formData, options)
      .map(res => res.json())
      .subscribe(response => {
      callback(response);
      }
      )
      });





      This code gets the entire document and sends it as a blob to our API receiver for comparison.



      The method of comparison among the documents being sent and on the database is through sha256 hash. The API converts the received document into a sha256 hash and compares it to all the hashes on the database. The code also serves as an "update" to the hash that's already on the database, with a different API link that still converts the document into a sha256 hash and puts that certain hash on the database to be compared in the future. This works seamlessly on Word Online; but when opening the document on Word Office 365, it fails. After calling the function, the API cannot find the document's hash on the database and will return an error. This is because the function sends a different document to the receiver. Upon exiting the Word application, we are prompted with the message:



      Dialog box



      We can conclude with this dialog box that there is something that is changed on the document. Agreeing to save the document and exiting the desktop application will change the document again because it was saved. Opening the document on Word Online and calling the function from there will result to a failed verification upon comparing the document’s hash to the ones on the database.



      To make things short, the getFileAsync function behaves differently on the desktop application compared to Word Online because it returns a document with the same contents but with a different metadata.



      Does someone know why this happens only on the desktop application and not on Word Online? Are there any workarounds for this issue?



      UPDATE:



      Apparently, this issue has now been closed by the PM assigned to it while suggesting the getOoxml() method from the Word API as a workaround. I've tried to redo the add-in with the code from the documentation and have found out that the bodyOOXML variable's value also changes upon calling the function.



      The PM stated to get the document element from the bodyOOXML and compare it to the existing one on the database; but upon manual inspection, I've found out that the <w:p w:rsidR="00000000" w:rsidRDefault="******"> element has always a different value for w:rsidRDefault after every invocation of the function. This will always lead to a negative result on the comparison. Moreover, I think that the document element from the output only takes the text from the document, excluding the images on it.
      Here is the w:document element from the bodyOOXML value:






      <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>





      Here is the download link of the XML files for a direct comparison.



      I am still on a deadlock with what to do on this. The recommendation has a bigger issue since it now even affects Word Online aside from the desktop versions. I hope anyone can help me on this.






      verifyDocument(callback){
      let method = 'getDocumentByFile'

      var promiseGetFileAsync = new Promise((resolve, reject) => {

      Office.context.document.getFilePropertiesAsync(function (asyncResult) {
      let fileUrl = asyncResult.value.url;
      let fileType = localStorage.getItem("Host");

      if (!fileUrl) {
      reject("Please save the file first")
      } else {

      Office.context.document.getFileAsync('compressed',
      {},
      function (result) {

      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var myFile = result.value;

      var state = {
      file: myFile,
      counter: 0,
      sliceCount: myFile.sliceCount
      };
      state.file.getSliceAsync(state.counter, function (result) {
      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var slice = result.value;
      var data = slice.data;
      var payload

      if (data) {

      payload = {
      method : method,
      data: data,
      fileType: fileType
      }
      resolve(payload);
      }

      state.counter++;
      if (state.counter > state.sliceCount) {

      }
      else {
      state.file.closeAsync();
      }

      }

      });
      }
      else {
      reject(result.error)
      }
      });
      }
      });
      })

      promiseGetFileAsync.then((data: any) => {

      let myHeaders = new Headers();
      myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
      let options = new RequestOptions({ headers: myHeaders });
      var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
      let formData: FormData = new FormData();
      formData.append('method', data.method);
      formData.append('document', file);

      this.http.post('Link to our API receiver', formData, options)
      .map(res => res.json())
      .subscribe(response => {
      callback(response);
      }
      )
      });





      verifyDocument(callback){
      let method = 'getDocumentByFile'

      var promiseGetFileAsync = new Promise((resolve, reject) => {

      Office.context.document.getFilePropertiesAsync(function (asyncResult) {
      let fileUrl = asyncResult.value.url;
      let fileType = localStorage.getItem("Host");

      if (!fileUrl) {
      reject("Please save the file first")
      } else {

      Office.context.document.getFileAsync('compressed',
      {},
      function (result) {

      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var myFile = result.value;

      var state = {
      file: myFile,
      counter: 0,
      sliceCount: myFile.sliceCount
      };
      state.file.getSliceAsync(state.counter, function (result) {
      if (result.status == Office.AsyncResultStatus.Succeeded) {

      var slice = result.value;
      var data = slice.data;
      var payload

      if (data) {

      payload = {
      method : method,
      data: data,
      fileType: fileType
      }
      resolve(payload);
      }

      state.counter++;
      if (state.counter > state.sliceCount) {

      }
      else {
      state.file.closeAsync();
      }

      }

      });
      }
      else {
      reject(result.error)
      }
      });
      }
      });
      })

      promiseGetFileAsync.then((data: any) => {

      let myHeaders = new Headers();
      myHeaders.append('Authorization', 'Bearer ' + localStorage.getItem('token'));
      let options = new RequestOptions({ headers: myHeaders });
      var file:any = new Blob([new Uint8Array(data.data)], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' });
      let formData: FormData = new FormData();
      formData.append('method', data.method);
      formData.append('document', file);

      this.http.post('Link to our API receiver', formData, options)
      .map(res => res.json())
      .subscribe(response => {
      callback(response);
      }
      )
      });





      <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>





      <w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:cx="http://schemas.microsoft.com/office/drawing/2014/chartex" xmlns:cx1="http://schemas.microsoft.com/office/drawing/2015/9/8/chartex" xmlns:cx2="http://schemas.microsoft.com/office/drawing/2015/10/21/chartex" xmlns:cx3="http://schemas.microsoft.com/office/drawing/2016/5/9/chartex" xmlns:cx4="http://schemas.microsoft.com/office/drawing/2016/5/10/chartex" xmlns:cx5="http://schemas.microsoft.com/office/drawing/2016/5/11/chartex" xmlns:cx6="http://schemas.microsoft.com/office/drawing/2016/5/12/chartex" xmlns:cx7="http://schemas.microsoft.com/office/drawing/2016/5/13/chartex" xmlns:cx8="http://schemas.microsoft.com/office/drawing/2016/5/14/chartex" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:aink="http://schemas.microsoft.com/office/drawing/2016/ink" xmlns:am3d="http://schemas.microsoft.com/office/drawing/2017/model3d" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:w16cid="http://schemas.microsoft.com/office/word/2016/wordml/cid" xmlns:w16se="http://schemas.microsoft.com/office/word/2015/wordml/symex" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 w16se w16cid wp14"><w:body><w:p w:rsidR="00000000" w:rsidRDefault="005D6ED5"><w:r><w:t>Test Word</w:t></w:r><w:r><w:rPr><w:noProof /></w:rPr><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0" wp14:anchorId="216A5B6F" wp14:editId="50917A19"><wp:extent cx="1096645" cy="1096645" /><wp:effectExtent l="0" t="0" r="8255" b="8255" /><wp:docPr id="1617038684" name="picture" /><wp:cNvGraphicFramePr><a:graphicFrameLocks xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" noChangeAspect="1" /></wp:cNvGraphicFramePr><a:graphic xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"><a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"><pic:nvPicPr><pic:cNvPr id="0" name="picture" /><pic:cNvPicPr /></pic:nvPicPr><pic:blipFill><a:blip r:embed="rId4"><a:extLst><a:ext uri="{28A0092B-C50C-407E-A947-70E740481C1C}"><a14:useLocalDpi xmlns:a14="http://schemas.microsoft.com/office/drawing/2010/main" val="0" /></a:ext></a:extLst></a:blip><a:stretch><a:fillRect /></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0" /><a:ext cx="1096645" cy="1096645" /></a:xfrm><a:prstGeom prst="rect"><a:avLst /></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r></w:p><w:sectPr w:rsidR="00000000"><w:pgSz w:w="12240" w:h="15840" /><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0" /><w:cols w:space="720" /></w:sectPr></w:body></w:document>






      office365 ms-office office-js






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 29 '18 at 1:45







      NinoNextix

















      asked Nov 29 '18 at 1:30









      NinoNextixNinoNextix

      13




      13
























          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53530580%2fbug-with-getfileasync-method-on-word-desktop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53530580%2fbug-with-getfileasync-method-on-word-desktop%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)