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

Re: Unwanted Spellcheck Dialog by Jonathan

Jonathan
Tue Jul 01 13:04:13 PDT 2008


"Curt" <Curt@discussions.microsoft.com> wrote in message
news:F159DEA8-640A-4611-91E9-9672D3EE40D5@microsoft.com...
> 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


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup