Hi,
The font in the Word table is Times New Roman 12.
In order to create the same font in FW, I do
DEFINE FONT NAME "Times New Roman" SIZE 0, 12Is this correct ?
Hi,
The font in the Word table is Times New Roman 12.
In order to create the same font in FW, I do
DEFINE FONT NAME "Times New Roman" SIZE 0, 12Is this correct ?
Dear Yuri,
You should use:
DEFINE FONT NAME "Times New Roman" SIZE 0, -12
Thank you, Antonio!
However, I did not notice the difference -font 12 and font -12 have a height of 10 pixels.
There is some text in the Word cell of the table. If it exceeds the width of the cell, then its height increases. I wanted to find out the number of substrings in a cell like this
nWc:=oTb:Item(1):Columns:Item(1):Width*1.333
ceiling(GetTextWidth(NIL, MyText, oFn:hFont)/nWc)However, I get a non-linear value :cry:
Hi Yuri,
can it help you to know the number of rows?
...
nRows := WdGetNRows( oDoc, 1, 2, 2 )
...
FUNCTION WdGetNRows( oDoc, nTable, nRow, nCol )
LOCAL Pos, CellHeight, CellHeight1, nRows, cBuf, nSizeRow
Pos := oDoc:Tables[nTable]:Cell( nRow, nCol ):Range:End - 1
CellHeight := oDoc:Range( Pos, Pos ):Information( 8 ) // wdVerticalPositionRelativeToTextBoundary 8
cBuf := LEFT( oDoc:Tables[nTable]:Cell( nRow, nCol ):Range:Text, LEN( oDoc:Tables[1]:Cell( nRow, nCol ):Range:Text ) - 2 )
oDoc:Tables[nTable]:Cell( nRow, nCol ):Range:Text := cBuf + CRLF
Pos := oDoc:Tables[nTable]:Cell( nRow, nCol ):Range:End - 1
CellHeight1 := oDoc:Range( Pos, Pos ):Information( 8 ) // wdVerticalPositionRelativeToTextBoundary 8
nSizeRow := CellHeight1 - CellHeight
oDoc:Tables[nTable]:Cell( nRow, nCol ):Range:Text := cBuf
IF CellHeight == 0
nRows := IIF( EMPTY( cBuf ), 0, 1 )
ELSE
nRows := INT( CellHeight / nSizeRow ) + 1
ENDIF
RETURN nRowsMassimo
Thanks, MaxP ! I checked, it doesn't work well for me. I'm quite happy with the GetTextWidth(() function. I think I'm misinterpreting the font of the office on FW.