views:

347

answers:

4

I have to check whether or not the client pc has MS Office 2007 installed or not.

How can I check this using javascript?

+4  A: 

You cannot do this from within a browser. The browser does not allow javascript access to the client computer. It would be a gaping security hole.

Microsoft gets around this by using Active X. There are other browser-to-desktop plugins that could accomplish the same thing.

Javascript, however, is a no-go.

Gabriel Hurley
thanks Gabriel Hhurley
Don't forget that javascript runs from the command-line using WScript or cscript.exe. It is possible to do from a non-browser script host.
Cheeso
+2  A: 

You can try to do this with ActiveX. Something like:

var word = new ActiveXObject("Word.Application");

and than check operation result.

Alex
A: 

Generally, this isn't possible.
However, if the client is using Internet Explorer, and has InfoPath installed (which is part of Office), you can check the user agent for InfoPath.2. Another option is to check for MS-RTC LM , if they have the Office Live Meeting installed.
This is very limiting, but it just might work on a local intranet.

Kobi
A: 

hi thanks have done this using following script

try{ var oApplication=new ActiveXObject("Word.Application"); if(oApplication){ document.write(oApplication.Version);

if(oApplication.Version == "12.0") { document.write("office07 installed"); }

} } catch( ex) { document.write(" not installed: "); document.write(ex.message); }

Thnaks for help

jazzy