0

In my plugin i try to get open file as byte array or base64 so i can send via API, is there any way to make that with Word-Js, also is there any way to return document size and name and meta data?

search in

 context.document.properties 
 Office.context.document.settings

but no result as expected

macropod
  • 12,757
  • 2
  • 9
  • 21
Mokh Akh
  • 421
  • 3
  • 14
  • Does this answer your question? [How to convert file to base64 in JavaScript?](https://stackoverflow.com/questions/36280818/how-to-convert-file-to-base64-in-javascript) – A-Tech Mar 24 '22 at 20:17
  • 1
    Also, this might help: [Get the whole document](https://learn.microsoft.com/en-us/office/dev/add-ins/word/get-the-whole-document-from-an-add-in-for-word) – Rick Kirkham Mar 24 '22 at 22:11
  • @RickKirkham thank you that exactly what i am looking for, do you know how get the document name – Mokh Akh Mar 24 '22 at 22:23
  • 1
    https://learn.microsoft.com/en-us/javascript/api/office/office.document?view=common-js-preview#office-office-document-getfilepropertiesasync-member(1) getFileProperties API will get the url of your file which contains the file name. – MSFT-Jipyua Mar 28 '22 at 07:43

0 Answers0