Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-02-2020, 11:43 AM
dinofanatic dinofanatic is offline autofldupdt macro - Modifying to keep part of file name Windows 10 autofldupdt macro - Modifying to keep part of file name Office 2019
Novice
autofldupdt macro - Modifying to keep part of file name
 
Join Date: Nov 2020
Posts: 5
dinofanatic is on a distinguished road
Default

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
Reply With Quote
 



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
autofldupdt macro - Modifying to keep part of file name 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
autofldupdt macro - Modifying to keep part of file name Copying a part of a docx file as a separate file officeboy09 Word 6 09-26-2014 05:15 PM
autofldupdt macro - Modifying to keep part of file name modifying a PST file ctspwc Outlook 5 11-17-2010 09:29 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft