This is driving me mad - i am developing what i thought was a simple addin for MS word using React and office JS.
I am loading https://appsforoffice.microsoft.com/lib/beta/hosted/office.js in my app, I have a working manifest and can sideload the app which renders as expected, until i try to create my word interactivity. I have fallen on the first hurdle, i need my addin to get a docx document, and then load - which should be possible using createDocument(base64) then load.
my problem is that:
Word.run(async context => {
var MyDoc = context.application.createDocument(getMyDocument());
context.load(MyDoc);
})
.catch(function (error) {
console.log('Error: ' + JSON.stringify(error));
if (error instanceof OfficeExtension.Error) {
console.log('Debug info: ' + JSON.stringify(error.debugInfo));
}
});
fails to compile with the error TS2339: Property 'application' does not exist on type 'RequestContext'.
however I can refer to context.document which will compile and add in paragraphs of text. I do not know where im going wrong at all.
Office version is Mac 2016 16.2 (181125) so should easily accept Word 1.3 API which has the functionality.
Googling has given no meaningful results which suggests its something i have missed rather than a common mistake.
Any help would be greatly appreciated.