Can't set the row height for table


I try to use the following code to adjust my table rows height. But it turns out failed. So is there any problem? And if not set it in this way, how to set it?

for (int x = 0; x <myTable.Rows.Count; x++)
    Row myRow = myTable.Rows[x];
    myRow.RowFormat.Height = 20;

Ken Wan


Thanks for your request. The following code works fine:

// Open document
Document doc = new Document(@"Test114\in.doc");
// Get table from the document
Table tab = doc.FirstSection.Body.Tables[0];
// loop theough all rows and specify height of each row
foreach(Row row in tab.Rows)
    row.RowFormat.Height = 20;
// Save output document

What do you mean when say “it turns out failed”? Please attach your documents for testing.
Best regards.