Word with Harbour and xHArbour Solved

Word with Harbour and xHArbour Solved

Postby Maurizio » Wed Feb 16, 2011 4:08 pm

Hello
I have this problem

This code works with xHarbour but with Harbour I have this error
Stack Calls
===========
Called from: => WIN_OLEAUTO:INVOKE(0)
#include "fivewin.ch"

function Main()
LOCAL oWord, oText

TRY
oWord := GetActiveObject( "Word.Application" )
CATCH
TRY
oWord := CreateObject( "Word.Application" )
CATCH
Alert( "ERROR! Word not avialable. [" + Ole2TxtError()+ "]" )
RETURN
END
END

oWord:Documents:Add()

oText := oWord:Selection()

oText:Font:Size := 16

oText:Invoke( "TypeText", "Test 1" + CRLF + CRLF )

oText:Font:Size := 8

oText:Invoke( "TypeText", "Test 2" + CRLF+ CRLF )

oText:Font:Size := 12

oText:Invoke( "TypeText", "Test 3" + CRLF+ CRLF )



oWord:Visible := .T.
oWord:WindowState := 1 // Maximize

return nil


Regards Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Word with Harbour and xHArbour Solved

Postby Maurizio » Wed Feb 16, 2011 5:50 pm

Change
oText:Invoke( "TypeText", "Test 1" + CRLF + CRLF )
with
oText:TypeText("Test 1" + CRLF + CRLF )

Regards
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: Word with Harbour and xHArbour Solved

Postby juan carlos bellucci » Tue May 29, 2012 2:09 pm

Hola Hasta Ahi creo un encabezado .. alguien sabe como hago para grabarlo sin entrar en word ?
juan carlos bellucci
 
Posts: 115
Joined: Sat Mar 07, 2009 9:36 pm
Location: Argentina

Re: Word with Harbour and xHArbour Solved

Postby nageswaragunupudi » Tue May 29, 2012 3:12 pm

Incidentally FWH provides builtin function WinWordObj().

We can write

oWord := WinWordObj()
if oWord == nil
// error
else
// proceed with using oWord
endif

Similar functions in FWH are ExcelObj() and SunCalcObj()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 113 guests