#include "FiveWin.Ch"
CLASS TWord
DATA oWord
DATA oDoc
METHOD New()
METHOD OpenDoc( cNombreDoc )
METHOD Replace()
METHOD SaveDocumento()
METHOD Visible INLINE ::oWord:Visible := .t.
ENDCLASS
METHOD NEW() CLASS TWord
IF ( ::oWord := win_oleCreateObject( "Word.Application" ) )= NIL
Msgstop(" Error al conectar con Word")
return
ENDIF
RETURN( Self )
METHOD OpenDoc( cNombreDoc ) CLASS TWord
::oDoc:=::oWord:Documents:open(cNombreDoc)
RETURN Nil
METHOD SaveDocumento(cNombreDoc) CLASS TWord
::oDoc:saveAs(cNombreDoc)
Return nil
METHOD Replace(cSrc, cRpl) CLASS TWord
local oSel:= ::oWord:Selection
oSel:Start = 0
oSel:End = -1
WHILE oSel:Find:Execute( cSrc )
oSel:Range:Text = cRpl
ENDDO
Return
...
DATA lConnected INIT .f.
...
METHOD NEW() CLASS TWord
::oWord := win_oleCreateObject( "Word.Application" )
::lConnected := ( ::Word != nil )
RETURN( Self )
// Luego en tu programa podria hacer:
...
oWObj := TWord():new()
if !oWObj:lConnected
Msgstop(" Error al conectar con Word")
else
...
endif
...
Vikthor.Thomas wrote:Hola :
Tengo la clase tword y tExcelSript funcionando para FWH64 + BCC7.1 y Harbour
A qué correo te las mando ?
Saludos
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 49 guests