bug in Touleauto (Solved)

bug in Touleauto (Solved)

Postby ukservice » Fri Jan 14, 2011 2:02 pm

Hello,

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

Code: Select all  Expand view
#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.
Last edited by ukservice on Fri Jan 14, 2011 8:33 pm, edited 1 time in total.
FWH 11.11, Harbour 3.1 and Borland C++ 5.82
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John

Re: bug in Touleauto

Postby Enrico Maria Giordano » Fri Jan 14, 2011 5:37 pm

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8711
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: bug in Touleauto

Postby ukservice » Fri Jan 14, 2011 8: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
User avatar
ukservice
 
Posts: 417
Joined: Tue Feb 23, 2010 3:09 pm
Location: John


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], nageswaragunupudi, RSalazarU and 91 guests