0

I am trying to create a Microsoft Word Add in. I would like the javascript Add in to have the ability to read and write to Microsoft Access and Microsoft Excel files. This is trivial with VBA, but I do not want to divide up the user experience between my Javascript add in and a VBA button in the original Word document. I would like to be able to read and write from the Javascript add in somehow.

I know I have access to things like Word.run(function (context) {..... from the docs, but example functions have nothing to do with accessing other documents.

What is the right way to access other Microsoft documents from a Javascript add in to read and write?

Thanks.

1 Answer 1

1

By "other Microsoft documents" I'll assume you are talking about any related files the user has stored on their PC. But these JavaScript for Office add-ins are essentially just web pages running in an embedded browser, and applications running in a browser are sandboxed and just don't have access to the local computer (without installing client helper applications).

So your app will need to prompt the user to upload a file to your web server where you can interact with the file using a relevant API (which would be a completely different topic). Or you can use web-based APIs to interact with web-based file systems (OneDrive/Graph, Dropbox, etc.).

Sign up to request clarification or add additional context in comments.

5 Comments

I meant Excel and Access. That seems rather roundabout to have to download to the server, then parse, then update the UI. Why wouldn't you be able to access the typical VBA macro type functions?
Can I reliably load an access database or excel spreadsheet, parse, then serve the results to add-in using node.js?
To be clear, with Word and Excel web add-ins you can read and modify the active document and worksheet when the add-in is launched. But other files need web access or user upload. But I doubt they'll open up VBA macros for access from a web add-in.
Thank you @Eric. I saw from your profile you are an add-in guru. Can I upload and download, from and to the server, through the add-in, as I can in a normal browser?
The add-in is really irrelevant - whatever you can do in any web page you can do in the add-in. Otherwise the add-in serves as a broker between your code and the document. If you need custom server side processing (e.g. ASP.NET Web API) you have to have a web application on your web server that you can communicate with from your add-in code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.