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
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();
string HeightRule =varDoc.Tables[1].Cell(0, 0).HeightRule.ToString();
float testHight=varDoc.Tables[1].Cell(0, 0).Height;
Russ said:
I am not sure what you want.
If you want to view one page in the window, then use the menu 'View/Page
Layout', then move to the 'Zoom' dropdown list in the main toolbar and
select 'Whole Page'. If you want to go to a certain page use menu Edit/Go
To...
I need to know the hight of context in a Microsoft word.
Then set the Page hight equte the hight of context.
Does anyone know how to do that?