T
Tywardreath
Hi
I have a template that is set up with headers/footers, different first page.
I use the following macro to update the filename field within the footer/s.
Sub AutoOpen()
Dim oField As Word.Field
Dim oRange As Word.Range
Set oRange = ActiveDocument.Sections(1).Footers(2).Range
If oRange.Fields.Count >= 1 Then
For Each oField In oRange.Fields
If oField.Type = wdFieldFileName Then
oField.Update
End If
Next
End If
End Sub
My problem is that it only updates the filename on the first page. Is there
anyway to change the code so it updates it on the 2nd and subsequent pages?
Cheers, Ty
I have a template that is set up with headers/footers, different first page.
I use the following macro to update the filename field within the footer/s.
Sub AutoOpen()
Dim oField As Word.Field
Dim oRange As Word.Range
Set oRange = ActiveDocument.Sections(1).Footers(2).Range
If oRange.Fields.Count >= 1 Then
For Each oField In oRange.Fields
If oField.Type = wdFieldFileName Then
oField.Update
End If
Next
End If
End Sub
My problem is that it only updates the filename on the first page. Is there
anyway to change the code so it updates it on the 2nd and subsequent pages?
Cheers, Ty