如何在WPS中选择光标所在的整个页面?
在word中选择光标所在的整个页面的代码如下:
Selection.GoTo What:=wdGoToBookmark, Name:="\page" ‘选定整个页面
在WPS中如何实现呢?
[解决办法]
Sub Selection_GoTo()
Dim StartRange As Long, EndRange As Long
Dim i As Integer, j As Integer
With Selection
i = .Information(wpsActiveEndPageNumber)
j = .Information(wpsNumberOfPagesInDocument)
If i < j Then
EndRange = .GoToNext(wpsGoToPage).Start
StartRange = .GoToPrevious(wpsGoToPage).Start
Else
EndRange = ActiveDocument.Content.End
StartRange = .GoToNext(wpsGoToPage).Start
End If
End With
ActiveDocument.Range(StartRange, EndRange).Select
End Sub