You could try an error handler:

Sub ScratchMacro()
'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 4/6/2018
Dim oPage As Page, oPagePrevious As Page
Dim oRngP As Range, oRngPP As Range
Dim lngIndex As Long
  On Error GoTo Err_View
  For lngIndex = ActiveWindow.ActivePane.Pages.Count To 2 Step -1
    Set oPage = ActiveWindow.ActivePane.Pages(lngIndex)
    Set oPagePrevious = ActiveWindow.ActivePane.Pages(lngIndex - 1)
    Set oRngP = oPage.Rectangles(4).Range
    Set oRngPP = oPagePrevious.Rectangles(4).Range
    oRngPP.Select
    If Asc(oRngPP.Characters.Last.Previous.Previous) = 12 Then
      oRngPP.End = oRngPP.End - 3
    Else
      oRngPP.End = oRngPP.End - 2
    End If
    If Asc(oRngP.Characters.Last.Previous.Previous) = 12 Then
      oRngP.End = oRngP.End - 3
    Else
      oRngP.End = oRngP.End - 2
    End If
    If oRngP.Text = oRngPP.Text Then
      oPage.Rectangles(4).Range.Delete
    End If
  Next
lbl_Exit:
  Exit Sub
Err_View:
 ActiveWindow.ActivePane.View.Type = wdPrintView
 Resume
End Sub