B
Brian McCullough
All,
I have some VB Script that loops through each field in a record and attempts
to do a "Find and Replace" for each instance in the active document. Here
is the code:
FieldName = objField.Name
FieldValue = objField.Value & ""
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "<<" & FieldName & ">>"
.Replacement.Text = FieldValue
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How do I get Word to replace instances of <<FieldName>> in the Header or
Footer section of the document with the FieldValue?
Thanks!
Brian
I have some VB Script that loops through each field in a record and attempts
to do a "Find and Replace" for each instance in the active document. Here
is the code:
FieldName = objField.Name
FieldValue = objField.Value & ""
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "<<" & FieldName & ">>"
.Replacement.Text = FieldValue
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
How do I get Word to replace instances of <<FieldName>> in the Header or
Footer section of the document with the FieldValue?
Thanks!
Brian