oWord:=CREATEOBJECT("Word.Application")
oWord:Documents:Add()
oRange:=oWord:ActiveDocument:Range()
and I insert a small table
oTable_Cliente:=oWord:ActiveDocument:Tables:Add(oRange,1,1)
WITH OBJECT oTable_Cliente
:Cells[1]:Range:InsertAfter( Trim("cliente:" ) )
:Cells[1]:Range:InsertAfter( CR )
:Cells[1]:Range:InsertAfter( "INDIRIZZO" )
:Columns:Autofit()
END
oWord:Visible := .t.
Return nil
and I wish move this table on the Right of the document , howI must make to show it ?
the test.prg
- Code: Select all Expand view
- #Include "FiveWin.ch"
#DEFINE wdAlignParagraphLeft 0
#DEFINE wdAlignParagraphCentre 1
#DEFINE wdAlignParagraphRight 2
#DEFINE wdCollapseEnd 0
#DEFINE wdStory 6
#DEFINE wdBorderTop -1
#DEFINE wdLineStyleDouble 7
#DEFINE CR CHR(13)
Function Main()
Local oTable_Cliente
Local oWord,oRange,nRecCount,nRow,nTotSalary:=0
oWord:=CREATEOBJECT("Word.Application")
oWord:Documents:Add()
WITH OBJECT oTable_Cliente
:Cell(1,1):Range:ParagraphFormat:Alignment:=wdAlignParagraphRight
:Cells[1]:Range:InsertAfter( Trim("cliente:" ) )
:Cells[1]:Range:InsertAfter( CR )
:Cells[1]:Range:InsertAfter( "INDIRIZZO" )
:Columns:Autofit()
END
oWord:Visible := .t.
Return nil