Albert Diago
Albert Diago

Reputation: 15

VBA, Move the cursor to the begining of the page in Microsoft Word

How to move the cursor to the beginning of the page? Using VBA Macro.

Upvotes: 1

Views: 3344

Answers (1)

Dirk Vollmar
Dirk Vollmar

Reputation: 176169

You can move the selection to the beginning of the current page using the following workaround (assuming you are starting from a collapsed selection):

If Selection.Range.Information(wdActiveEndPageNumber) = 1 Then
    Selection.GoTo wdGoToPage, wdGoToNext
    Selection.GoTo wdGoToPage, wdGoToPrevious
Else
    Selection.GoTo wdGoToPage, wdGoToPrevious
    Selection.GoTo wdGoToPage, wdGoToNext
End If

Upvotes: 2

Related Questions