Unwanted Spellcheck Dialog

C

Curt

Hi All...

I'm trying to use Office 2007's (and 2003...) Word to spellcheck a field on
a web form. I'm using javascript running in the browser on a client machine.
I'm using the following code...

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

word.Visible = false;
word.WindowState = 2;
word.DisplayAlerts = false;

var doc = word.Documents.Add();
doc.Content = 'Hello World, I can spel.';
doc.CheckSpelling();

var count = doc.SpellingErrors.Count;

When it runs, the call to CheckSpelling seems to hang. Upon investigation,
I find a dialog under all of my other windows offering to help resolve the
spelling error - a spellcheck dialog. I dont want that dialog - I'd rather
resolve the spelling issues programmatically from within my javascript. How
do I keep that dialog from popping up?

Many thanks. -- Curt
 
J

Jonathan West

Curt said:
Hi All...

I'm trying to use Office 2007's (and 2003...) Word to spellcheck a field
on
a web form. I'm using javascript running in the browser on a client
machine.
I'm using the following code...

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

word.Visible = false;
word.WindowState = 2;
word.DisplayAlerts = false;

var doc = word.Documents.Add();
doc.Content = 'Hello World, I can spel.';
doc.CheckSpelling();

var count = doc.SpellingErrors.Count;

When it runs, the call to CheckSpelling seems to hang. Upon
investigation,
I find a dialog under all of my other windows offering to help resolve the
spelling error - a spellcheck dialog. I dont want that dialog - I'd
rather
resolve the spelling issues programmatically from within my javascript.
How
do I keep that dialog from popping up?

You don't use the CheckSpelling method. If you look in the VBA help, you
will see that this is specifically intended to display the spelling dialog.
Instead, you manipulate the SpellingErrors collection, which is a collection
of Range objects indicating miss-spelled words
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top