gerar arquivos em word usando harbour
Enviado: 24 Abr 2023 08:05
Gracias. Super many thanks. resuelto, resolved.
Regards, saludos.
Código: Selecionar todos
// [url]https://forums.fivetechsupport.com/viewtopic.php?f=6&t=43084&sid=9e2195b9f98be69732a3ffa73a33b1db[/url]
// [url]https://forums.fivetechsupport.com/viewtopic.php?f=3&t=43093&sid=f314821d04e916bc11c25c4b9d2426a6[/url]
// C:\FWH..\SAMPLES\WORDCENT.PRG - Modificado by Jimmy/Natter/Rao.
#Include "FiveWin.ch"
// Harbour/xHarbour:
#xtranslate CentimetersToPoint(<n>)=>(<n>*28.35)
//#xtranslate PointToCentimeters(<n>)=>(<n>/28.35)
#xtranslate PointToCentimeters(<n>)=>(<n>*28.35)
FUNCTION Main()
LOCAL oWord, nCms
// Convert 2.5 centimeters to points
LOCAL nPts
oWord := WinWordObj()
oWord := CreateObject("Word.Application")
IF EMPTY( oWord )
MsgInfo( "Microsoft Word not installied" )
RETURN NIL
ENDIF
#ifdef __XHARBOUR__
nPts := PointToCentimeters( 2.5 ) // xHarbour
#else
nPts := oWord:CentimetersToPoints( 2.5 ) // Harbour
#endif
// nCms := 2.5
// nPts := nCms * 28.35
// Display the result
MsgInfo("2.5 centimeters = " + Str(nPts) + " points")
// Quit Word
oWord:Quit()
RETURN NIL
// FIN / END