Someone Please Help Me (Client-Side VBScript)

Status
Not open for further replies.
Yes, I know VBScript really isn't a great client-side language because of broswer compatibility, etc. But all the machines here are the same, so it doesn't matter.

OK, now on to my question. I'm trying to use Word's spell checker to check the contents of a textarea. I found this code online:
code:<HR>
Code:
 <SCRIPT LANGUAGE=vbscript>
    <!--
    Function SpellChecker(TextValue)
    	
    	Dim objWordobject
    	Dim objDocobject 
    	Dim strReturnValue
    	
		'Create a new instance of word Application
    	Set objWordobject = CreateObject("word.Application")
    	objWordobject.WindowState = 2
    	objWordobject.Visible = True
    	
		'Create a new instance of Document
    	Set objDocobject = objWordobject.Documents.Add( , , 1, True)
    	objDocobject.Content = TextValue
    	objDocobject.CheckSpelling
    	
		'Return spell check completed text data
    	strReturnValue = objDocobject.Content
    	
		'Close Word Document 
    	objDocobject.Close false
    	
		'Set Document to nothing
    	Set objDocobject = Nothing
    	
		'Quit Word
    	objWordobject.Application.Quit True
    	
		'Set word object to nothing
    	Set objWordobject = Nothing<P>    SpellChecker = strReturnValue
	
    End Function 
    -->
</SCRIPT>

I've put this in the <head> of my page. My problem is calling it from the page. I want to have a button that onclick checks the spelling of Time_Description (in form1) and after checking the spelling, sets the value of Time_Description to the updated text.

Anyone have any ideas?
 
Status
Not open for further replies.
of my page. My problem is calling it from the page. I want to have a button that onclick checks the spelling of Time_Description (in form1) and after checking the spelling, sets the value of Time_Description to the updated text.\n\nAnyone have any ideas?" }, "publisher": { "@type": "Organization", "name": "Ars OpenForum", "url": "/civis" } }