在一篇有上百页的word文档里,如何全选当前页的内容呢,当然可以用鼠标拖选的老办法,这里介绍几种新办法方法一:1.光标点在页末,按“Shift+PageUp”;2.光标点在开头,按“Shift+PageDown”;3.“Shift+鼠标单击”;4.“Shift+(→←↑↓)”。方法二:下面的代码的功能是,全选word文档的当前页,注意,是当前页,即插入条所在的页,而不是全文。Dim CurrentPageStart As Long, CurrentPageEnd As Long, myRange As RangeDim Currentpage As Integer, Pages As IntegerOn Error Resume NextCurrentpage = Selection.Information(wdActiveEndPageNumber)Pages = Selection.Information(wdNumberOfPagesInDocument)CurrentPageStart = Selection.GoTo(what:=wdGoToPage, Which:=wdGoToNext, Name:=Currentpage).startIf Currentpage = Pages ThenCurrentPageEnd = ActiveDocument.Content.EndElseCurrentPageEnd = Selection.GoTo(what:=wdGoToPage, Which:=wdGoToNext, Name:=Currentpage + 1).startEnd IfSet myRange = ActiveDocument.Range(CurrentPageStart, CurrentPageEnd)myRange.select 注意,以上代码在VBA环境下使用。
免责声明:本站内容仅用于学习参考,信息和图片素材来源于互联网,如内容侵权与违规,请联系我们进行删除,我们将在三个工作日内处理。联系邮箱:chuangshanghai#qq.com(把#换成@)