I am doing below for word document :-
Step 1. Open document from base64 . Please check below link . Document is open with random name like Document1, Document 2
await Word.run(async (context) => {
var newDoc = context.application.createDocument(base64);
context.load(newDoc);
//Want to give document name like newDoc.name ="sample documents"
return context.sync().then(function () {
newDoc.open();
});
});
Step-2 We are passing base 64 from our Rest API so want to open document with new name and also pass some custom data to new documents .
OfficeJS
doesn't provide anything for that out of the box.
Feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: Type: product feature request
at https://aka.ms/M365dev-suggestions .