Window.Open(//File Path) method will help you to open any file.
Why to Use Client Side Automation
Open Excel file
objExcel = new ActiveXObject("Excel.Application");
objExcel.Visible = true;
Open Word file
objDoc = new ActiveXObject("Word.Application");
objDoc.Visible = true;
Problem Might Occur
While dealing with
ActiveXObject, mostly security threat occurs that will lead to the following error.
To overcome this error, we have to change the browser setting. InternetExplorer --> Tools --> InternetOntions --> Security --> Custom Level.
Select the following option:
This article opens Word/Excel using ActiveX object and unfortunately, these AciveX Plugins are only supported by Internet Explorer (tested on IE6/7/8).
Points of Interest
Client side automation is a good alternative to server side automation. Server side automation is not recommended by Microsoft itself. Here is the post.
- 6th August, 2011: Initial version