View Single Post
 
Old 07-07-2022, 01:15 PM
mark99k's Avatar
mark99k mark99k is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2012
Location: California USA
Posts: 20
mark99k is on a distinguished road
Default

Having a macro create a selection in a header is iffy at best (and if you ever actually need it, a better way is ActiveWindow.View.SeekView). Here, though, you're better off replacing your entire second loop with just this:

Code:
For Each xHeader In xSec.Headers
    xHeader.Range.Find.Execute FindText:="^p^p^p", ReplaceWith:="^p^p", Replace:=wdReplaceAll
Next xHeader
Reply With Quote