Author: Sebastian Volland I want to add rows to an existing table but have difficulties using InsertRows. Does anyone have an example? Answer: 1 uses 2 ComObj; 3 4 procedure TForm1.Button1Click(Sender: TObject); 5 var 6 App, WordDoc, tabelle: OLEVariant; 7 begin 8 try 9 {Create MSWord instance} 10 App := CreateOleObject('Word.Application'); 11 except 12 {Error...} 13 Exit; 14 end; 15 {Open a Word Document} 16 WordDoc := App.Documents.Open('c:\test.doc'); 17 {Insert a table} 18 tabelle := WordDoc.Tables.Add(App.Selection.Range, 5 {Columns}, 4 {Rows}); 19 {Write sth into a cell} 20 tabelle.Cell(2 {Column}, 4 {Row}).Range.Text := '123'; 21 {Append row to table} 22 23 App.Selection.Tables.Item(1).Rows.Item(App.Selection.Tables.Item(1).Rows.Count).Sele 24 ct; 25 App.Selection.InsertRowsBelow; 26 {Set Column width} 27 App.Selection.Tables.Item(1).Columns.Item(1).SetWidth(ColumnWidth := 40, 28 RulerStyle := $00000000 {wdAdjustNone}); 29 {Show MSWord} 30 App.Visible := True; 31 {Cleanup...} 32 App := Unassigned; 33 WordDoc := Unassigned; 34 tabelle := Unassigned; 35 end;