Word addin, set filename

lulo.leg 1 Reputation point
2022-09-23T12:24:30.947+00:00

Hello,

If one starts a blank file on Word you can usually see in the top bar a name such as "Document1", "Document2" and so on.

Yet, if you attempt to open a file using the Word JS API like this:

   Word.run((context) => {  
     context.application.createDocument(documentB64).open()  
     return context.sync()  
   })  

The top bar comes out like this:
244248-image.png

No filename is set.

To set a filename/handle(?), I tried using the code given here https://stackoverflow.com/questions/50275496/office-js-add-customproperty-to-new-document but that didn't help.

My addin is usually used in conjunction with another (VSTO) add-on and that add-on can't work properly with the documents opened by my addin and I believe the lack of a filename (/handle?) explains it to some extent.

Is there something I can do about this?

Thank you

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
863 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,458 questions
0 comments No comments
{count} votes