View Single Post
 
Old 07-08-2019, 08:43 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,138
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If the aim of the game is to delete xxx and yyy from each page but the first then

Code:
Sub DelTexts()
Dim vFind As Variant
Dim oRng As Word.Range
Dim i As Integer
    vFind = Array("xxx", "yyy")
    For i = 0 To UBound(vFind)
        Set oRng = ActiveDocument.Range
        With oRng.Find
            Do While .Execute(FindText:=vFind(i), MatchWildcards:=True)
                If oRng.Information(wdActiveEndPageNumber) > 1 Then
                    oRng.Text = ""
                End If
                oRng.Collapse 0
            Loop
        End With
    Next i
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote