`
Par2: Inheriting and using MS Word Dictionary and Spell Checker 2000-05-12 -- Oleg Chernov > Has anyone tried to inherit the Microsoft Office Spell Checker and > Dictionary into their app? > We'd like to use the spell checker from Office to check text boxes on my > app's forms. > Does anyone know if this is possible, and if so is there a template or third > party add-on to do so? > > Some sample code would also be appreciated :-) > TIA It's easy using Ole Automation Look on this example: Declare two variables: WordObject long CheckString string(1000) ! string for CheckSpelling Code ! create temporary Ole Control WordObject = create(0,prop:ole) ! Create MS Word Document Object WordObject{prop:create}='Word.Document' ! Hidden Word Window WordObject{'Application.Visible'}=False ! Copy checkString into Word WordObject{'Application.Selection.Text'}=CheckString ! start CheckSpelling WordObject{'Application.ActiveDocument.CheckSpelling'} ! Copy CheckString back CheckString = WordObject{'Application.Selection.Text'} ! close document and Quit from MsWord WordObject{'close'} WordObject{'Application.Quit'} WordObject{prop:deactivate} Destroy(WordObject} Printed November 21, 2024, 11:19 am This article has been viewed/printed 35212 times. |