Hi I use the following bit of code for spellchecking in an access application.
VB Code:
Private Function Spellchecknew(TextStr As String) As String Dim WordApp As Word.Application Set WordApp = CreateObject("Word.Application") WordApp.Documents.Add Dim wordrange As Word.Range Set wordrange = WordApp.ActiveDocument.Range(0, 0) wordrange.Text = TextStr WordApp.Visible = True WordApp.Activate wordrange.CheckSpelling , , True wordrange.CheckGrammar Spellchecknew = wordrange.Text wordrange.Text = "" WordApp.Documents.Close (False) WordApp.Quit Set WordApp = Nothing 'MsgBox "test" End Function
It nearly allways hangs in Access for about 5 seconds after the above is run, so I tried to find out what was causing the delay, but if you include the msgbox "test" at the end, the program doesn't freeze, infact it works out quicker to keep the message box command in and then click okay, than it does to remove it.
Why would this be, and how could I dulicate this without using a message box. have tried things like me.repaint but it's still the same,
