简体   繁体   中英

Word vba, determine range of pages already selected

I know how to select specific pages and how to use Selection.

However, how do you determine which pages have been selected in Word?

Thanks in advance!

Michael

You might start with something like:

Sub Demo()
With Selection.Characters
  MsgBox "Your selection spans page(s): " & _
    .First.Information(wdActiveEndPageNumber) & " - " & _
    .Last.Information(wdActiveEndPageNumber)
End With
End Sub

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM