C# word 下一页 翻页 页数

来源:互联网 发布:软件爆破教程 编辑:程序博客网 时间:2024/04/30 03:42

说明:因为业务需要,需要在Winform显示Word文件,但是因为Word的内容太多,则需要自动翻页。

以下做一下记录,以备后续查询的需要。用的AxDSOFramer.AxFramerContro这个控件去显示的Word。

翻页的核心的代码如下:

Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)axFramerControl1.ActiveDocument;doc.Windows.Application.ActiveWindow.View.Zoom.Percentage = iPrecentage;//显示小翻页,即只翻一个屏幕的内容doc.Windows.Application.ActiveWindow.LargeScroll(1);//显示大翻页,即翻一整页的内容//d.Windows.Application.ActiveWindow.PageScroll(1);


另外附上获取Word页数的方法:

object Nothing = System.Reflection.Missing.Value;int iPageCount = doc.ComputeStatistics(Microsoft.Office.Interop.Word.WdStatistic.wdStatisticPages, ref Nothing);



0 0
原创粉丝点击