Spellchecking with MS Word, PLEASE HELP!

Results 1 to 4 of 4

Thread: Spellchecking with MS Word, PLEASE HELP!

  1. #1
    Rai Guest

    Default Spellchecking with MS Word, PLEASE HELP!

    I found a tutorial for "spellchecking with Microsoft word spell checker utility" (it can be found at http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=4&txtCodeId=6561 ). There is a screenshot there showing how its supposed to look but I dont get it right, can somebody please try it out and help me!<BR>------------<BR>This is the function:<BR><BR>&#060;SCRIPT LANGUAGE=vbscript&#062;<BR> &#060;!--<BR> &#039;SpellChecker<BR> &#039; PURPOSE: This function accepts Text da<BR> &#039; ta for which spell checking has to be do<BR> &#039; ne. <BR> &#039; Return&#039;s Spelling corrected data <BR> &#039; <BR> function SpellChecker(TextValue)<BR> <BR> Dim objWordobject<BR> Dim objDocobject <BR> Dim strReturnValue<BR> &#039;Create a new instance of word Application<BR> Set objWordobject = CreateObject("word.Application")<BR> objWordobject.WindowState = 2<BR> objWordobject.Visible = True<BR> &#039;Create a new instance of Document<BR> Set objDocobject = objWordobject.Documents.Add( , , 1, True)<BR> objDocobject.Content=TextValue<BR> objDocobject.CheckSpelling<BR> &#039;Return spell check completed text data<BR> strReturnValue = objDocobject.Content<BR> &#039;Close Word Document <BR> objDocobject.Close False<BR> &#039;Set Document To nothing<BR> Set objDocobject = Nothing<BR> &#039;Quit Word<BR> objWordobject.Application.Quit True<BR> &#039;Set word object To nothing<BR> Set objWordobject= Nothing<BR> SpellChecker=strReturnValue<BR> End function <BR> --&#062;<BR> &#060;/SCRIPT&#062;<BR><BR><BR><BR>------------<BR>And this is a suggestion on how it can be used with a form, from the same tutorial, when I use this I get an error:<BR><BR>&#060;FORM <BR>name="frm"&#062;&#060;TEXTAREA<BR>name=x&#062; &#060;/TEXTAREA&#062;<BR>&#060;INPUT<BR>TYPE="button" <BR>onClick="frm.x.value=<BR>SpellChecker(frm.<BR> x.value)"&#062;&#060;/form&#062;<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default The obvious

    The notes stated that this code assumes the client machine has Word 2000. Do you? It worked fine for me and I have Word 2000.

  3. #3
    Join Date
    Dec 1969

    Default RE: Spellchecking with MS Word, PLEASE HELP!

    that&#039;s some cool code, thanks<BR><BR>it might have to do with a conflict between word2000 and older version that may be installed<BR><BR>or maybe word isn&#039;t installed on the box you&#039;re using<BR><BR>just a thought

  4. #4
    Rai Guest

    Default RE: The obvious

    Thanks, I didnt see that. But because I saw this message in the feedback...<BR>---<BR>I get an error when trying to <BR>instantiate the word object on the Set <BR>objWordobject = <BR>CreateObject("word.Application")<BR> <BR>line. I have Office 2000 installed on <BR>my machine, does this use a different <BR>class name than word.application ?<BR>---<BR>...I assumed the opposite; that it was only for earlier versions... Do you think there is any way of making this work for earlier word-versions? Otherwise I guess I cant use this because there is not a large percent that use the 2000 version yet...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts