|
-
Apr 4th, 2001, 02:32 PM
#1
Thread Starter
New Member
the spell check is working fine, but i want to keep word running the entire time my application is running. the problem i run into is that a new document is created everytime spellcheck is called. what i would like is for the document to be closed once the spell check is finished. here's the code i have thus far...:
Public Function SpellCheck(ByVal IncorrectText$) As String
'Dim oWord As Object, retText$
On Error Resume Next
Set oWord = CreateObject("Word.Basic")
' the next line was added to try keep things invisible
oWord.Visible = True
oWord.AppMinimize
oWord.FileNew
oWord.Insert IncorrectText
' open the spellchecker in word ...
oWord.ToolsSpelling
oWord.EditSelectAll
' done immediately before to minimize possibility of
' interaction with the clipboard
retText = oWord.Selection$()
SpellCheck = Left$(retText, Len(retText) - 1)
frmCustAds.ActiveControl.Text = SpellCheck
oWord.FileCloseAll 2
' following two lines have to do with invisibility
'oWord.AppClose
oWord.Visible = False
Set oWord = Nothing
End Function
is there an opposite function to CreateObject() that i could use to kill each document when this is called?
thank you in advance...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|