` Printed Icetips Article

Icetips Article



Par2: Spell checking a memo
2000-06-08 -- Ray Dummer
 
!Declare two variables:

WordObject long
CheckString string(1000)
! string for CheckSpelling

!Embed point where you want to check the spelling

WordObject=create(0,create:ole)                         ! create temporary
Ole Control
WordObject{prop:create}='Word.Document'                 ! Create MS Word
Document Object
WordObject{'Application.Visible'}=False                 ! Hidden Word Window

WordObject{'Application.Documents.Add'}                 ! Create new
document
WordObject{'Application.Selection.Text'}=CheckString    ! Copy checkString
into Word
WordObject{'Application.ActiveDocument.CheckSpelling'}  ! start
CheckSpelling

CheckString = WordObject{'Application.Selection.Text'}  ! Copy CheckString
back
WordObject{'Application.ActiveWindow.WindowState'}=2    ! close document and
Quit from MsWord
WordObject{'Application.ActiveDocument.Close(0)'}       ! Closing without
save
WordObject{'close'}
WordObject{'Application.Quit'}
WordObject{prop:deactivate}
Destroy(WordObject)



Printed November 21, 2024, 6:53 am
This article has been viewed/printed 35330 times.