tWord Class

Post Reply
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

tWord Class

Post by Colin Haig »

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

Regards

Colin
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: tWord Class

Post by Otto »

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

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: tWord Class

Post by Colin Haig »

Hi Otto

I am using Word 2003.

Regards

Colin
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: tWord Class

Post by StefanHaupt »

Colin,

here you can download it

http://www.box.net/shared/o8om8gj295
kind regards
Stefan
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: tWord Class

Post by Colin Haig »

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
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: tWord Class

Post by StefanHaupt »

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
Colin Haig
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: tWord Class

Post by Colin Haig »

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
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: tWord Class

Post by StefanHaupt »

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: Select all

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
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: tWord Class

Post by StefanHaupt »

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: Select all

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: tWord Class

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
hmpaquito
Posts: 1200
Joined: Thu Oct 30, 2008 2:37 pm

Re: tWord Class

Post by hmpaquito »

Dear Antonio,

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

http://forums.fivetechsupport.com/viewt ... RD#p200152

Regards
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: tWord Class

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply