You will find a macro (function) below that should do the job. Some comments
first:
1. Three different footers exist: first page footer, primary footer, even
page footer. In the macro, I have assumed your footer is a "primary footer" –
it is if the document does not have "Different first page" and "Different odd
and even" turned on in File > Page Setup > Layout tab.
2. In a document with more than one section, the macro will only replace
text in the footer of section 1.
3. The function has a parameter, sReplacement. When calling the function,
sReplacement must be set to the value of ProjNum (supposed to be a string).
You can use the following line of code to call the function:
ReplaceTextInFooter sReplacement:=ProjNum
This will execute the function below. The function can be placed in any
module.
Function ReplaceTextInFooter(sReplacement As String)
Dim oRange As Range
Set oRange =
ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range
With oRange.Find
.Text = "<Project #>"
.Replacement.Text = sReplacement
.Execute Replace:=wdReplaceAll
End With
Set oRange = Nothing
End Function
--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word