-
Notifications
You must be signed in to change notification settings - Fork 67
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
TypeError: context.document.insertFileFromBase64 is not a function #2137
Comments
Hi @MJSQ,
Also, you should reference office.js through our CDN: https://learn.microsoft.com/en-us/office/dev/add-ins/develop/referencing-the-javascript-api-for-office-library-from-its-cdn?view=word-js-preview. That ensures your add-in always has the latest version of office.js. |
@MJSQ Also note that the office-js NPM package isn't the recommended path for Office.js (see the "Support" section of the @microsoft/office-js package readme). |
Thanks for your reply. It has been fixed in word-win32-16.01.js version. |
Download via NPM package in the use of The context.document.insertFileFromBase64 causes problems, by replacing the word-win32-16.01.js and office.js to fix the problem. |
context.document.body.insertFileFromBase64(templateBase64, "Replace");//This is fine, but information like headers is not preserved
context.document.insertFileFromBase64(templateBase64, "Replace");//TypeError: context.document.insertFileFromBase64 is not a function |npm> "name": "@microsoft/office-js","version": "1.1.95"
Please let us know which version I support context. Document.InsertFileFromBase64?Or is there another way to preserve the headers and all styles of the template file??
The text was updated successfully, but these errors were encountered: