Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - My .vbs file for spell checking

Reply
 
Old 03-13-2009   #1 (permalink)
AAaron123


 
 

My .vbs file for spell checking

I didn't realise there was a vbscript NG so I submitted the below in the Wsh
NG. I hope it makes sense to resubmit here!


I want to have an icon on my desktop that open a spell checker. So I use
Check.vbs as below.
The problem is it is:

1) Slow to open
2) If word defaults to no check my app does not check.
3) It's my first script so I'd appreciate an suggestions that improve it.

Thanks in advance

Option Explicit
Dim objWord, Word, WshShell, BtnCode, strSuggestion, lstSuggestions
Const wdDoNotSaveChanges = 0

Set objWord = CreateObject("Word.Application")
Set WshShell = WScript.CreateObject("WScript.Shell")

Do While True

word = InputBox ("What word would you like to check?","Type the word to
check","")

if word = "" then
objWord.Quit (wdDoNotSaveChanges)
Set objWord = Nothing
set WshShell = nothing
WScript.Quit
end if

objWord.visible=False
objWord.Documents.Add.Content = word

if objWord.CheckSpelling(word) then
lstSuggestions = "Word is spelled OK."
else
lstSuggestions = ""
for each strSuggestion in objWord.GetSpellingSuggestions(word)
lstSuggestions = lstSuggestions & vbCrLf & strSuggestion
next
end if
'Set WshShell = WScript.CreateObject("WScript.Shell")
BtnCode = WshShell.Popup(lstSuggestions, , "Spelling Suggestions
for """ & word & """. Click OK to Enter Another Word", 1 + 32)

Select Case BtnCode
case 2
objWord.Quit (wdDoNotSaveChanges)
Set objWord = Nothing
set WshShell = nothing
WScript.Quit

case -1 WScript.Echo "Is there anybody out there?"
End Select

Loop




My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Spell checking Vista mail
Spell checking Vista mail
Spell Checking anywhere Software
Spell Checking Vista mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46