Microsoft Word 2000 from the Web
-
Hi, I need some help with a question. First I am using VBScript for a client side spellchecker. The code below works but does not keep the rich text formatting that I need. Sub RichTextSpellChecker(ItemToCheck) Dim WordObject Dim WordDocumentObject Dim strReturnValue Dim strValueToCheck strValueToCheck = "" & document.getElementById(ItemToCheck).innerTEXT IF NOT (strValueToCheck = "") THEN 'let the user know that the spelling is being checked. window.status = "Spell Check is processing, please wait this may take a few seconds." 'Create a new instance of word Application Set WordObject = CreateObject("word.Application") 'set window parameters WordObject.WindowState = 2 WordObject.Visible = False 'Create a new instance of Document and add the text to the document Set WordDocumentObject = WordObject.Documents.Add( , , 1, True) WordDocumentObject.Content = strValueToCheck WordDocumentObject.CheckSpelling 'Return spell check completed text data strReturnValue = WordDocumentObject.Content 'give the corrected spelling to the textbox that was checked 'MsgBox(strReturnValue) document.getElementById(ItemToCheck).innerTEXT = strReturnValue ' House Cleaning 'Close Word Document WordDocumentObject.Close False 'Set Document To nothing Set WordDocumentObject = Nothing 'Quit Word WordObject.Application.Quit True 'Set word object To nothing Set WordObject= Nothing 'let the user know that the spell check has completed. just incase it takes a few seconds to reload the page. window.status = "Spell check is complete" END IF End Sub As you can see I am using innerTEXT because if I try to use innerHTML the spellchecker will come back and tell me that HI is spelled incorrectly. Is there a way to keep the text formatting while using the spellchecker? Thanks William O'Malley __________________