View Single Post
 
Old 03-27-2015, 07:30 AM
gmayor's Avatar
gmayor gmayor is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

The following macro used as a custom process with
should do this. Try it on one of the documents first. The code will not process the footer if the change has already been made.

Code:
Function NewFooter(oDoc As Document) As Boolean
Dim oSection As Section
Dim oFooter As HeaderFooter
Dim oRng As Range
Const strFind As String = "A list of employees is open for inspection at our offices."
Const strAddText As String = "ABC Brewery is the trading name of ABC Brewery PLC, registered in England and Wales with company number ABC999." & vbCr
    On Error GoTo err_Handler
    For Each oSection In oDoc.Sections
        For Each oFooter In oSection.Footers
            If oFooter.Exists Then
                Set oRng = oFooter.Range
                If InStr(1, oFooter.Range.Text, strAddText) = 0 Then
                    With oRng.Find
                        Do While .Execute(FindText:=strFind)
                            oRng.InsertBefore strAddText
                            Exit Do
                        Loop
                    End With
                End If
            End If
        Next oFooter
    Next oSection
    NewFooter = True
lbl_Exit:
    Exit Function
err_Handler:
    NewFooter = False
    Resume lbl_Exit
End Function
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote