一个统计Word文档中行数的VBA例程

这是一个计算Word中文档行数的例程(表格中的行数不算)。

 

Sub test()
     Dim i As Integer
     Dim t As Table
     
    i = ActiveDocument.range.ComputeStatistics(wdStatisticLines)
     For Each t In ActiveDocument.Tables
         i = i - t.range.ComputeStatistics(wdStatisticLines)
     Next
     MsgBox i
 End Sub




欢迎访问我的主博客《许阳的红泥屋

posted @ 2012-07-02 19:23  许阳 无锡  阅读(668)  评论(0编辑  收藏  举报