FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour tWord Class
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
tWord Class
Posted: Mon May 18, 2009 08:59 AM

Hi
Can anyone point me to where I can download tWord class or send me a copy.

Regards

Colin

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
Re: tWord Class
Posted: Mon May 18, 2009 04:12 PM

Hello Colin,
what word version do you plan to work with?

Best regards,
Otto

Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: tWord Class
Posted: Mon May 18, 2009 10:54 PM

Hi Otto

I am using Word 2003.

Regards

Colin

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: tWord Class
Posted: Tue May 19, 2009 07:58 AM
Colin,

here you can download it

http://www.box.net/shared/o8om8gj295
kind regards

Stefan
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: tWord Class
Posted: Tue May 19, 2009 08:47 AM

Hi Stefan

I tried both twordx.prg and tword2.prg but in both cases it does not work but I
am using FWH 7.12 and xHarbour build 1.0.0 which are both quite old - do I need
to update to use Tword.

Thanks

Colin

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: tWord Class
Posted: Tue May 19, 2009 11:50 AM

Hi Colin,

TWord is dated from 2003 / 2006, it should work with older versions of fwh.

I didn´t use it in my apps,but the sample is working here. What error do you get ?

Maybe there differences in the commands word uses. I´m not sure if it´s working with Office 2003 or 2007.

kind regards

Stefan
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: tWord Class
Posted: Tue May 19, 2009 01:58 PM

Stefan

This is the error using twordx.prg

Path and name: C:\dev\wca\wca.exe (32 bits)
Size: 2,328,576 bytes
Time from start: 0 hours 0 mins 7 secs
Error occurred at: 19/05/2009, 21:55:36
Error description: Error BASE/1004 Class: 'NIL' has no exported method: GET
Args:
[ 1] = U
[ 2] = C Documents

Stack Calls

Called from: tget.prg => GET(0)
Called from: Twordx.prg => TWORD:OPENDOC(376)
Called from: report7.prg => REPORT7(13)
Called from: Main.prg => (b)MAINMENU(149)
Called from: MENU.PRG => TMENU:COMMAND(0)
Called from: WINDOW.PRG => TWINDOW:COMMAND(0)
Called from: MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: => WINRUN(0)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: Main.prg => MAIN(92)

I am trying to open an existing word 2003 document.

Cheers

Colin

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: tWord Class
Posted: Wed May 20, 2009 07:31 AM
Colin,

it seems, that ::oWord is still nil, maybe the ole connection failed.

Please replace the Method New () with this one to be sure that ::oWord is initialized:

Code (fw): Select all Collapse
METHOD   NEW()  CLASS TWord
      ::lWord  := .T.
      TRY
        ::oWord := GetActiveObject( "Word.Application" )
      CATCH
         TRY
            ::oWord := CreateObject( "Word.Application" )
         CATCH
            Alert( "ERROR! Word is not installed on this PC. [" + Ole2TxtError()+ "]" )
            ::lWord  := .F.
         END
      END
RETURN( Self )
kind regards

Stefan
Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: tWord Class
Posted: Fri May 22, 2009 04:39 PM
Colin,

I made some tests and I found the problem.

The method OpenDoc (cNombre) needs the filename with its full path to work correctly.

Code (fw): Select all Collapse
oWord := TWord():New()

//oWord:NewDoc('Creswin.doc')  // not working !
oWord:OpenDoc ("d:\xbase\xharbour\tword\Creswin.doc") // working fine


Hope it helps
kind regards

Stefan
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: tWord Class
Posted: Wed Apr 24, 2019 04:29 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: tWord Class
Posted: Wed Apr 24, 2019 06:06 PM

Dear Antonio,

I think that tword class is buggy for last harbour and fivewin editions.

viewtopic.php?f=6t=33813hilit=TWORD#p200152

Regards

&&

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: tWord Class
Posted: Thu Apr 25, 2019 06:36 AM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion