Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE Automation of MS Word

Status
Not open for further replies.

Ed2020

Programmer
Nov 12, 2001
1,899
GB
Hi,

I am trying to use the following code to spell check the contents of an MS Access 2000 textbox:

Dim X As Object
Set X = CreateObject("Word.Application")
X.Visible = False
X.Documents.Add
X.Selection.Text = Text1.Text
X.ActiveDocument.CheckSpelling
Text1.Text = X.Selection.Text
X.ActiveDocument.Close False
X.Quit
Set X = Nothing

This works fine unless the spell checker finds an incorrectly spelt word and the user hits the Cancel button on the resulting dialog box. If this happens what is pasted back into the textbox appears to be nothing but a series of carriage returns.

Can anyone suggest what I need to do in order to fix this?

Cheers,

Ed Metcalfe.

Please do not feed the trolls.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top