Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect if MS Word is installed

Status
Not open for further replies.

grx21

Programmer
Aug 3, 2001
45
0
0
US
I am designing a web app that needs to detect if MS word is installed on a client system. If it is installed the web app will send the user to a specific page, if it is not istalled it will prompt the user and tell him/her that MS word need to be installed in order to proceed. I am new to asp and I have no clue on how to do it. Any help will be very much appreciated.

Thanks,

grx21
 
try this

<script language="vbscript">
function detectWord()
on error resume next
set objWordDoc = CreateObject("Word.Document")
if (err.number<>0) then
detectWord=false
else
detectWord=true
end if
set objWordDoc=nothing
end function
</script>

<script language="javascript">
if (document.all) {
if (detectWord()) alert("You have MS Word installed.");
else alert("You must allow ActiveX control to run in your browser and \nYou must have

Microsoft Word installed in your computer.");
}
</script>
 
Hi steven290, thanks for your reply and the script. The script works and doesn't work.

First, I tested the script on a web server (it was the only machine that I could find without ms office or ms word installed). I accessed the script with Internet Explorer and it worked, it told me that I needed to install ms word.

Then, I tested the script from a machine (other than the web server) with ms office & ms word installed. I accessed the script but it told me that I needed to install ms word although ms office and ms word are installed.

Out of suspicion, I took the html page containing the script and put it on a machine that has ms office/ms word installed and when I ran the html page it worked perfectly it told me that I had ms word installed.

However, that doesn't help because the html page containing the script will have to reside on the web server for all the client to access it.

Any thoughts or suggestions?

Thanks,

grx21
 
I forgot to mention that the script when it worked it only worked with Internet Explorer. The other browsers (Firefox, Netscape, Opera) ignored it.

grx21
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top