mangohappy

如何统计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);

 

发表于 2010-10-27 13:14  ┢┦aРpY  阅读(405)  评论(0编辑  收藏  举报
 

分类:

技术点:

相关文章:

  • 2021-11-18
  • 2021-07-01
  • 2021-12-26
  • 2022-01-12
  • 2021-12-24
  • 2021-05-31
猜你喜欢
  • 2021-04-19
  • 2022-01-29
  • 2021-10-12
  • 2021-12-25
  • 2021-06-04
  • 2021-12-25
  • 2022-02-07
相关资源
相似解决方案