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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top