|
From: Curt on 1 Jul 2008 11:21 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
From: Jonathan West on 1 Jul 2008 16:04 "Curt" <Curt(a)discussions.microsoft.com> wrote in message news:F159DEA8-640A-4611-91E9-9672D3EE40D5(a)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
|
Pages: 1 Prev: showing two modal windows in Word 2000 and before Next: Marco/Hyperlink |