You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are developing a Word add-in, and one of the key features is the ability to:
-Retrieve the Word document as a Base64 string (including OOXML content such as custom XML parts) and replace the document content using the method below:
// Insert the modified Base64 OOXML back into the document Retrving base64 code.txt
However, when we replace the content and save the document, retrieving the Base64 content again does not provide the updated or valid Base64 string.
await context.document.insertFileFromBase64(base64Content, "Replace", {
importTheme: true,
importStyles: true,
importParagraphSpacing: true,
importPageColor: true,
importChangeTrackingMode: true,
importCustomProperties: true,
importCustomXmlParts: true
});
Here are my questions:
Are there any limitations with the insertFileFromBase64 method when inserting content? If so, is there any documentation or reference for this?
After replacing the content using the above method and saving the document, why does the Base64 retrieved afterward not reflect the updated content?
This issue is a blocker for us, and I would appreciate your suggestions on how to resolve it.
The text was updated successfully, but these errors were encountered:
Hi @Piyush-IT , sorry for the late reply. To answer your questions,
Q: Are there any limitations with the insertFileFromBase64 method when inserting content? If so, is there any documentation or reference for this? A: Please refer to this doc, the limitation is "Insertion isn't supported if the document being inserted contains an ActiveX control (likely in a form field). Consider replacing such a form field with a content control or other option appropriate for your scenario.“
Q: After replacing the content using the above method and saving the document, why does the Base64 retrieved afterward not reflect the updated content? A: The provided script retrieves the document content as a Base64 string and then re-inserts the same content back into the document without making any modifications. It's expected behavior the updated content should be same as the original content. Please correct me if I understood the question wrong.
We are developing a Word add-in, and one of the key features is the ability to:
-Retrieve the Word document as a Base64 string (including OOXML content such as custom XML parts) and replace the document content using the method below:
// Insert the modified Base64 OOXML back into the document
Retrving base64 code.txt
However, when we replace the content and save the document, retrieving the Base64 content again does not provide the updated or valid Base64 string.
await context.document.insertFileFromBase64(base64Content, "Replace", {
importTheme: true,
importStyles: true,
importParagraphSpacing: true,
importPageColor: true,
importChangeTrackingMode: true,
importCustomProperties: true,
importCustomXmlParts: true
});
Here are my questions:
This issue is a blocker for us, and I would appreciate your suggestions on how to resolve it.
The text was updated successfully, but these errors were encountered: