dupa

Author Topic: spell checker uhp file as requested  (Read 1751 times)

lightspeed

  • Hero Member
  • *****
  • Posts: 6766
    • View Profile
spell checker uhp file as requested
« on: January 29, 2009, 07:06:42 pm »
Rem Type=Plugin
Rem Name=Spell Checker
Rem Author=Bill DeWitt
Rem Host=Assistant

'This sub sets up the plug-in's option panel in Hal's options dialog
Sub OptionsPanel()
    lblPlugin(0).Caption = "This should help correct your input sentence on any computer with MSWord"
    lblPlugin(0).Move 120, 120, 3300, 1200
    lblPlugin(0).WordWrap = True
    lblPlugin(0).Visible = True
End Sub

Rem PLUGIN: PRE-PROCESS
Dim Word, Doc, Uncorrected, Corrected
Const wdDialogToolsSpellingAndGrammar = 828
Const wdDoNotSaveChanges = 0
Uncorrected = InputString
Set Word = CreateObject("Word.Application")
Set Doc = Word.Documents.Add
Word.Selection.Text = Uncorrected
Word.Dialogs(wdDialogToolsSpellingAndGrammar).Show
If Len(Word.Selection.Text) <> 1 Then
   Corrected = Word.Selection.Text
Else
   Corrected = Uncorrected
End If
Doc.Close wdDoNotSaveChanges
Word.Quit
InputString = Corrected