问题
The Ewa namespace is documented here:
https://msdn.microsoft.com/en-us/library/office/ee589018.aspx
It's pretty easy to use, but certain calls are not documented and there's no sample code. The source for Ewa.js is here: https://s1-excel-15.cdn.office.net/x/sc/1662281009__layouts/App_Scripts/Ewa.js But it's minimized.
If you look at the source, you will see that there's a call named "InsertDeleteCells". If you put a breakpoint there, and then attempt to delete a row from the spreadsheet in edit mode, the breakpoint will hit.
Does anyone know how to make that call? I'm assuming the starting point is the _Ewa and Ewa global objects, and that I would have to pass in the Session ID which I can get from the Ewa.EwaControl
Alternatively, if someone from Microsoft is willing to provide the non-minimized versions of Ewa.js and EwsMoss.js (probably called Ewa.debug.js and EwaMoss.debug.js), I can do the rest of the work.
回答1:
I checked with the Excel team. The APIs called by Ewa.js are purely internal, so they may (and will) change over time. That is why they are not documented, and why there is not a non-minified version. While you may be able to hack something together that calls these APIs, such solution would be very fragile and susceptible to breaking, so it's not something we could, in good faith, recommend. Essentially, only the "Ewa" namespace is public, while anything under "_Ewa" is intentionally private.
Hope this helps,
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT
来源:https://stackoverflow.com/questions/33621787/i-want-to-use-the-ewa-api-to-make-calls-into-methods-that-are-in-the-ewa-js-ew