简体   繁体   中英

Is it possible to open an application installed on client machine using client side scripting languages

I need a suggestion to clarify my thought.Now I am working on a Web application in ASP.NET MVC5 with Angularjs as the front end framework. Is there any way to open client side application like MS Word/Outlook using any scripting languages like jquery,ajax,angularjs etc.

Yes you can open any MS-WORD document using ActiveXObject .
Following is the sample code to print file data on webpage.

var w=new ActiveXObject(‘Word.Application’);
if (w != null)

{

w.Visible = true; //set to false to stop the Word document from opening

obj=w.Documents.Open("C:\\blank.doc"); //this can be any location on your PC, not just C:

docText = obj.Content;

w.Selection.TypeText("Hello world!");

w.Documents.Save();

document.write(docText);//Print on webpage

For more information you can refer here.

In general, no, because that would be a huge security hole and lead to the spread of viruses and malware.

In certain specific cases where you can control the user's computer already, you may be able to do it (eg Internet Explorer with trusted sites as Strom said).

But it's not really worth pursuing such options as they are being aggresively shut down by browser vendors all the time.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM