Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Retrieving Updated Base64 After Using insertFileFromBase64 in Word Add-In #4928

Open
Piyush-IT opened this issue Sep 26, 2024 · 2 comments
Assignees
Labels
Area: add-ins platform Issue related to the add-ins platform

Comments

@Piyush-IT
Copy link

Piyush-IT commented Sep 26, 2024

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:

  1. Are there any limitations with the insertFileFromBase64 method when inserting content? If so, is there any documentation or reference for this?
  2. 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.
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Sep 26, 2024
@pinverso pinverso added Area: add-ins platform Issue related to the add-ins platform and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Sep 30, 2024
@Piyush-IT
Copy link
Author

is there any update because it is blocker for us.

Thanks in Advance.

@qinliuMSFT
Copy link
Member

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.

Thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: add-ins platform Issue related to the add-ins platform
Projects
None yet
Development

No branches or pull requests

3 participants