I use Word Application object to operate a Microsoft Word file.
I would like to know the current the hight of a specific cell in the table.
When the HeightRule is wdRowHeighAuto and the Height propertys always be 9999999.0.
How to do get the current Height of the cell
// Declaring the object variables we will need later string HeightRule =varDoc.Tables[1].Cell(0, 0).HeightRule.ToString();
object varFileName = "c:\\test\\CellTest.docx";
object varFalseValue = false;
object varTrueValue = true;
object varMissing = Type.Missing;
// Create a reference to MS Word application
Microsoft.Office.Interop.Word.Application varWord = new Microsoft.Office.Interop.Word.Application();
//set printer
varWord.ActivePrinter = "Microsoft Office Live Meeting Document Writer";
// Creates a reference to a word document
Microsoft.Office.Interop.Word.Document varDoc = varWord.Documents.Open(ref varFileName, ref varMissing, ref varFalseValue, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing, ref varMissing);
// Activate the document
varDoc.Activate();
float testHight=varDoc.Tables[1].Cell(0, 0).Height;