new ActiveXObject('Word.Application') creates new winword.exe process when IE security does not allo

Posted by Mark Ott on Stack Overflow See other posts from Stack Overflow or by Mark Ott
Published on 2010-03-11T18:17:53Z Indexed on 2010/03/11 18:19 UTC
Read the original article Hit count: 1254

We are using MS Word as a spell checker for a few fields on a private company web site, and when IE security settings are correct it works well. (Zone for the site set to Trusted, and trusted zone modified to allow control to run without prompting.)

The script we are using creates a word object and closes it afterward. While the object exists, a winword.exe process runs, but it is destroyed when the word object is closed.

If our site is not set in the trusted zone (Internet zone with default security level) the call that creates the word object fails as expected, but the winword.exe process is still created. I do not have any way to interact with this process in the script, so the process stays around until the user logs off (users have no way to manually destroy the process, and it wouldn't be a good solution even if they did.)

The call that attempts to create the object is...

try { oWordApplication = new ActiveXObject('Word.Application'); } catch(error) { // irrelevant code removed, described in comments.. // notify user spell check cannot be used // disable spell check option }

So every time the page is loaded this code may be run again, creating yet another orphan winword.exe process.

oWordApplication is, of course, undefined in the catch block.

I would like to be able to detect the browser security settings beforehand, but I have done some searching on this and do not think that it is possible.

Management here is happy with it as it is. As long as IE security is set correctly it works, and it works well for our purposes. (We may eventually look at other options for spell check functionality, but this was quick, inexpensive, and does everything we need it to do.)

This last problem bugs me and I'd like to do something about it, but I'm out of ideas and I have other things that are more in need of my attention.

Before I put it aside, I thought I'd ask for suggestions here...

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about activexobject