An Office service that supports add-ins to interact with objects in Office client applications.
createDocument() from base64 or url result in RichApi.Error: GeneralException
I am trying to open an existing document from within a Word add-in. I tried:
var newDoc = context.application.createDocument(base64Image)
newDoc.open()
context.sync()
but I'm am getting an error: Uncaught (in promise) RichApi.Error: GeneralException.
When I don't pass in an argument into createDocument(), it successfully opens a blank document.
I've placed the base64Image into the current document using insertFileFromBase64 and insertInlinePictureFromBase64, so I know the base64Image file is supported.
Any other ideas?
Microsoft 365 and Office | Development | Office JavaScript API
Microsoft 365 and Office | Word | For business | Windows
A family of Microsoft word processing software products for creating web, email, and print documents.