[英]VBA for MS word to find text in document
这将允许您指定从第3页到第20页的范围
Sub Sample()
Dim rng As Range
Dim StartPage As Long, EndPage As Long
StartPage = 3: EndPage = 20
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=StartPage
Set rng = Selection.Range
Selection.GoTo What:=wdGoToPage, Which:=wdGoToAbsolute, Count:=EndPage
rng.End = Selection.Bookmarks("\Page").Range.End
'~~> Now you have got your range. Do the necessary action here
With rng
End With
End Sub
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.