lparameters raColumnHeaders, pnColumns * raColumnHeaders = array of header text to put in the first row * pnColumns = number of columns in the array/current work area dimension raColumnHeaders[pnColumns] local loRange, loTable, loCell, i, j, lnRecno lnRecno = recno() with this.moWord.Selection loRange = .Range loTable = this.moWord.ActiveDocument.Tables.Add( loRange, reccount() + 1, pnColumns ) for j = 1 to pnColumns loCell = loTable.Cell( 1, j ) loCell.Range.InsertAfter( raColumnHeaders[j] ) endfor for i = 1 to reccount() goto i scatter to laRow for j = 1 to pnColumns if ( type( "laRow[j]" ) == "C" ) laRow[j] = alltrim( laRow[j] ) endif loCell = loTable.Cell(i+1,j) loCell.Range.InsertAfter( laRow[j] ) endfor endfor endwith goto lnRecno this.TableAutoFit( loTable ) return loTable