Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim sSection As Section
Dim hFooter As HeaderFooter
Dim shpShape As Shape
' Loop through each section in the document
For Each sSection In ActiveDocument.Sections
' Loop through each footer in each section
For Each hFooter In sSection.Footers
' If the footer is the Primary footer
If hFooter.Index = wdHeaderFooterPrimary Then
' Loop through each Shape object in the header
For Each shpShape In hFooter.Shapes
' If the shapetype is a text box
If shpShape.Type = msoTextBox Then
With shpShape.TextFrame.TextRange.Find
.ClearFormatting
.Replacement.ClearFormatting
.Style = ActiveDocument.Styles("Style A")
.Replacement.Style = ActiveDocument.Styles("Style B")
.Execute findtext:="My text", _
Wrap:=wdFindContinue, replacewith:="My text", _
replace:=wdReplaceAll
End With
End If
Next
End If
Next
Next