setup
for large docs on cloud, especially the ones with numberous tracked changes, it could take quite some time for MS Word to show the page number on the lower left corner. and saving time's what i'm after.
solution
the plan
- go to the first character of the selected text.
- find out the page number of that location.
- pop up a MsgBox to display the info.
programming language & module(s)
- VBA
file preps
make the doc to be processed the active document, i.e. the one where the cursor currently is in.
variables to customize
none.
the script
vPno
Sub vPno() | |
Dim selRng As Range | |
Application.ScreenUpdating = False | |
Set selRng = Selection.Range | |
With Selection | |
If Len(.Text) > 1 Then | |
.Collapse wdCollapseStart | |
End If | |
MsgBox "page #" & .Information(wdActiveEndPageNumber) | |
End With | |
selRng.Select | |
Application.ScreenUpdating = True | |
End Sub |
output

note to self
none.