如何统计Word文档的总页数
using Microsoft.Office.Interop.Word;
Object Nothing = Missing.Value;
_Application WordApp = new ApplicationClass();
_Document WordDoc = WordApp.Documents.Open(
ref mDocPath, ref Nothing, ref Nothing, ref Nothing,
ref Nothing, ref Nothing, ref Nothing, ref Nothing,
ref Nothing, ref Nothing, ref Nothing, ref Nothing,
ref Nothing, ref Nothing, ref Nothing, ref Nothing);
// 统计页数
Int32 mDocPages = WordDoc.ComputeStatistics(WdStatistic.wdStatisticPages, ref Nothing);
// 关闭文档
WordDoc.Close(ref Nothing, ref Nothing, ref Nothing);
// 退出程序
WordApp.Quit(ref Nothing, ref Nothing, ref Nothing);