Share via

createDocument() from base64 or url result in RichApi.Error: GeneralException

AG 1 Reputation point
2022-04-12T17:30:23.623+00:00

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
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.