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?
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?