FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour bug in Touleauto (Solved)
Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
bug in Touleauto (Solved)
Posted: Fri Jan 14, 2011 02:02 PM
Hello,

This code, which worked with previous versions of FWH, does not work anymore:

Code (fw): Select all Collapse
#include "FiveWin.ch"

function Main()

local texto := "the bery vest"

msgalert(SpellCheck(Texto))
return nil


/*
* --------------------------------------------------------------------------*
(c) Forum Fivetech
* --------------------------------------------------------------------------*
*/
STATIC FUNCTION SpellCheck(Texto)
LOCAL oWord,oDoc,oTexto
LOCAL cText:=Texto

oWord:=TOleAuto():New( "Word.Application" )
oWord:Visible := .F.
oWord:Documents:Add()
oDoc := oWord:Get("ActiveDocument")

oTexto := oWord:Selection()
oTexto:Text := Texto

oDoc:CheckSpelling()

cText := oTexto:Text

oDoc:Close(0)
oWord:Quit()
oTexto:=NIL
oDoc:=NIL
oWord:=NIL

IF ! EMPTY(cText)
    Texto := cText
ENDIF
RETURN(Texto)



This is the error:

Error occurred at: 01/14/11, 14:59:36
Error description: (DOS Error -2147352570) WINOLE/1009 No exported method: GET
Args:
[ 1] = C ActiveDocument

Stack Calls
===========
Called from: => TOLEAUTO:GET(0)
Called from: test.prg => SPELLCHECK(22)
Called from: test.prg => MAIN(7)


What is wrong?.

Thank you.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: bug in Touleauto
Posted: Fri Jan 14, 2011 05:37 PM

Your sample works fine here using latest FWH and latest xHarbour from CVS.

EMG

Posts: 417
Joined: Tue Feb 23, 2010 03:09 PM
Re: bug in Touleauto
Posted: Fri Jan 14, 2011 08:33 PM

I found the solution:

oDoc := oWord:ActiveDocument

I don´t know why this change, but it works fine now.

FWH 11.11, Harbour 3.1 and Borland C++ 5.82

Continue the discussion