Hi there.
I'm having a problem creating a table in word. I write a string to the current document and then call ConvertToTable to convert the last paragraph.
the following is a code fragment
RangeW: Word2000.Range;
v1: Variant;
ATable: Table;
ARow: Row;
begin
RangeW := FWordDoc.Document.Paragraphs.Last.Range;
v1 := RangeW;
v1.ConvertToTable(
Separator:=wdSeparateByTabs, NumColumns:=4, NumRows:=9, Format:=wdTableFormatNone, ApplyBorders:=True, ApplyShading:= True, ApplyFont:=True, ApplyColor:=True, ApplyHeadingRows:=True, ApplyLastRow:=True, ApplyFirstColumn:=True, ApplyLastColumn:=False,
AutoFit:=True, AutoFitBehavior:=wdAutoFitFixed)
The problem is that my data string contains '-' chars and despite the fact that I have specified that the string is tab delimited, the hyphens throw off the formatting.
If I 'convert text to table' via the table menu in word the table formats correctly, so it appears not to be a problem with ConvertToTable.
Any help appreciated!
I'm having a problem creating a table in word. I write a string to the current document and then call ConvertToTable to convert the last paragraph.
the following is a code fragment
RangeW: Word2000.Range;
v1: Variant;
ATable: Table;
ARow: Row;
begin
RangeW := FWordDoc.Document.Paragraphs.Last.Range;
v1 := RangeW;
v1.ConvertToTable(
Separator:=wdSeparateByTabs, NumColumns:=4, NumRows:=9, Format:=wdTableFormatNone, ApplyBorders:=True, ApplyShading:= True, ApplyFont:=True, ApplyColor:=True, ApplyHeadingRows:=True, ApplyLastRow:=True, ApplyFirstColumn:=True, ApplyLastColumn:=False,
AutoFit:=True, AutoFitBehavior:=wdAutoFitFixed)
The problem is that my data string contains '-' chars and despite the fact that I have specified that the string is tab delimited, the hyphens throw off the formatting.
If I 'convert text to table' via the table menu in word the table formats correctly, so it appears not to be a problem with ConvertToTable.
Any help appreciated!