当前位置: 代码迷 >> VBA >> 怎样在word中选取一整页?解决方法
  详细解决方案

怎样在word中选取一整页?解决方法

热度:1369   发布时间:2013-02-26 00:00:00.0
怎样在word中选取一整页?
想选取a.doc其中第二页,然后存为b.doc
应该怎么做呢?

------解决方案--------------------------------------------------------
Private Sub test()
Dim rng As Range
Dim intStart As Integer
Dim intEnd As Integer
ActiveDocument.Range(0, 1).Select
With Selection
.GoTo(what:=wdGoToPage, which:=wdGoToNext, Count:=1).Select
intStart = .Start
.GoTo(what:=wdGoToPage, which:=wdGoToNext, Count:=1).Select
intEnd = .End
End With
ActiveDocument.Range(intStart, intEnd).Select

End Sub
  相关解决方案