View Single Post
 
Old 04-29-2019, 06:36 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You should be able to do it with something like:
Code:
Sub DeletePages()
Application.ScreenUpdating = False
Dim p As Long, Rng As Range
With ActiveDocument
  For p = .ComputeStatistics(wdStatisticPages) To 1 Step -1
    Set Rng = .Range.GoTo(What:=wdGoToPage, Count:=p).GoTo(What:=wdGoToBookmark, Name:="\Page")
    If Rng.HighlightColorIndex = wdNoHighlight Then Rng.Delete
  Next
End With
Application.ScreenUpdating = True
End Sub
On my system, though, Word isn't implementing the .Goto correctly - seems an MS Update has broken it.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote