robinmk
06-23-2010, 04:29 AM
Hi,
I've use the macro recorder to create the following:
WordBasic.ViewFooterOnly
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[INSERT NAME OF CONTRACTOR]"
.Replacement.Text = "John Smith"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
I'm assuming that WordBasic.ViewFooterOnly selects the footer, so what is the command to switch back to text (or deselect footer)?
Many Thanks
I've use the macro recorder to create the following:
WordBasic.ViewFooterOnly
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "[INSERT NAME OF CONTRACTOR]"
.Replacement.Text = "John Smith"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
With Selection
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseStart
Else
.Collapse Direction:=wdCollapseEnd
End If
.Find.Execute Replace:=wdReplaceOne
If .Find.Forward = True Then
.Collapse Direction:=wdCollapseEnd
Else
I'm assuming that WordBasic.ViewFooterOnly selects the footer, so what is the command to switch back to text (or deselect footer)?
Many Thanks