Here is my spell check function:
#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Word.au3>
Local $hGui = GUICreate("Spell Checker", 461, 212)
Local $idString = GUICtrlCreateEdit('“To be, or not to be…that is the question” This wellknown utterance has been the source of both mystery and wonderment for students around the world since the turn of the 16th century—arguably the zenith of Shakespeare’s creative output. However, the mere ubiquity of this phrase fails to answer some basic questions about it’s rather context. Where did it come from what does it mean? The first of these questions (where does it come from?) can be answered fairly easily: from Shakespeare’s famous play Hamlet.', 7, 23, 330, 81, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL))
Local $idSpellCheck = GUICtrlCreateButton("Check Spelling", 346, 23, 107, 22)
Local $idUpdate = GUICtrlCreateEdit('', 7, 123, 330, 81, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL))
Local $idCloseGui = GUICtrlCreateButton("Close", 346, 183, 107, 22)
ControlFocus($hGui, "", $idSpellCheck)
GUISetState()
While 1
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE
Exit
Case $idCloseGui
Exit
Case $idSpellCheck
GUICtrlSetData($idUpdate, _SpellCheck(GUICtrlRead($idString)))
EndSwitch
WEnd
Func _SpellCheck($sStringCheck)
Local Const $wdDialogToolsSpellingAndGrammar = 828 ;~ Word Spelling and Grammar Dialog Window
Local $oWord, $oDoc, $sSpellCheck = $sStringCheck
$oWord = _Word_Create(False)
With $oWord
;.Visible = False
$oDoc = .Documents.Add
.Selection.Text = $sSpellCheck
.Dialogs($wdDialogToolsSpellingAndGrammar).Show
$sSpellCheck = .Selection.Text
$oDoc.Close($wdDonotSaveChanges)
.Quit($wdDonotSaveChanges)
EndWith
Return $sSpellCheck = "" ? $sStringCheck : $sSpellCheck
EndFunc