Question

I wrote an office addin and with which there is a function : openFile(String path) and in the office addin I embed a browser object and with that I can embed a webpage on the office addin, and now I hope I can call the C# function "openFile" and pass in a path in the webpage with javascript, and let office open the designated file for me . Is this possible ? What can I do ?

Was it helpful?

Solution

Yes it is possible.

This is done via the window.external property (and ObjectForScripting on the host side). See WebBrowser Control Overview under the FAQ.

Happy coding.

Edit: However, there is likely not a way to access the value supplied to a file upload field unless you use a BHO -- this is a secondary question/issue, if it exists.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top