![]() |
#2
|
|||
|
|||
![]()
So between that original link, the new code posted here, and some googling I think I've managed to get close to what I would like to achieve. The problem I'm currently having is running into
Run-Time Error '6083' Objects in this document contain links to files that cannot be found. The linked information will not be updated. at the ".SourceFullName = Replace(.SourceFullName, OldPath, NewPath)" line. I've manually added the kb 70154 registry patch that was referenced in a couple forums. Also went through and made sure all automatic update switches were removed. 1) Anything else I can try? 2) Does this macro also replace links in footers? 3) Am I on the right track with this code? Here's a snippet of the relevant sections: ... ' Set the new filename NewFile = Split(ActiveDocument.Name, ".")(0) NewFile = Replace(NewFile, "Final Report", "Tables") ... ' Go through the fields in the story range. For Each Fld In Rng.Fields With Fld ' Skip over fields that don't have links to external files. If Not .LinkFormat Is Nothing Then With .LinkFormat OldPath = Left(.SourceFullName, InStrRev(.SourceFullName, "")) ' Replace the link to the external file if it differs. If OldPath <> NewPath Then .SourceFullName = Replace(.SourceFullName, OldPath, NewPath) ' Replace the source filename with the new filename OldFile = Split(.SourceName, ".")(0) .SourceFullName = Replace(.SourceFullName, OldFile, NewFile) On Error Resume Next .AutoUpdate = False On Error GoTo 0 |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Corrupted Footnotes After Modifying File on Macbook! | MusculaR_MinD | Word | 3 | 12-12-2019 06:09 PM |
![]() |
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 |
![]() |
officeboy09 | Word | 6 | 09-26-2014 05:15 PM |
![]() |
ctspwc | Outlook | 5 | 11-17-2010 09:29 PM |