![]() |
|
#7
|
|||
|
|||
|
Got it working! Ended up having to include a loop to specifically search the footers.
Code:
For j = 1 To ThisDocument.Sections.Count
For j = 1 To ThisDocument.Sections.Count
For k = 1 To 3
For Each Fld In ThisDocument.Sections(j).Footers(k).Range.Fields
With Fld
' Skip over fields that don't have links to external files.
If Not .LinkFormat Is Nothing Then
With .LinkFormat
' Replace the source filename with the new filename
OldPath = Left(.SourceFullName, InStrRev(.SourceFullName, "\"))
OldFile = .SourceName
StrTmp = Replace(.SourceFullName, OldPath, NewPath)
StrTmp = Replace(StrTmp, OldFile, NewFile)
' Replace the link to the external file if it differs.
If .SourceFullName <> NewPath & NewFile Then
.SourceFullName = StrTmp
On Error Resume Next
.AutoUpdate = False
On Error GoTo 0
End If
End With
End If
End With
Next Fld
Next k
Next j
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Corrupted Footnotes After Modifying File on Macbook! | MusculaR_MinD | Word | 3 | 12-12-2019 06:09 PM |
macro to change part of the name of an existing Word file
|
justinmo | Word VBA | 2 | 09-11-2018 06:08 PM |
| Modifying RTF File in MS Word 2007 | Nickster | Word VBA | 2 | 12-02-2015 11:33 PM |
Copying a part of a docx file as a separate file
|
officeboy09 | Word | 6 | 09-26-2014 05:15 PM |
modifying a PST file
|
ctspwc | Outlook | 5 | 11-17-2010 09:29 PM |