Search and replace inside header or footer (Buscar y reemplazar en el encabezado o pie de página)

Joined
Apr 12, 2016
Messages
1
Reaction score
0
This code works fine with Word 2016 (este código funciona bien con Word 2016):

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter 'Replace wdSeekCurrentPageFooter with wdSeekCurrentPageHeader for page header (reemplace wdSeekCurrentPageFooter con wdSeekCurrentPageHeader para encabezados)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "YourTargetText"
.Replacement.Text = "ReplaceThatWithThis"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

Is there another way?
 
Back
Top