I'm currently developing a Word add-in using the word-15.js script. I'm trying to save the document on some location. I assume that calling document.save(), saves the document to a location where the document already exists, so only if the document has been saved before and isn't a new document.
In my scenario, I'm trying to save/load a new document. For instance, when the user has created a new document and entered some text or other data, my add-in can load a SharePoint document library and save the that location. For instance: https://my-tenant.sharepoint.com/sites/my-site/_api/web/GetFolderByServerRelativeUrl('Shared Documents')/Files/add(url='test.docx', overwrite=true).
I haven't seen this done in any examples that I've been able to scramble through. Is this even possible? And if so, how?