WORDPIPE notes it can "Server renaming or replacement where document links need updating"
(google that.)
We have 1000's of .docx files that have embedded links to Excel documents. The server name was changed/migrated and now when a file is opened, the links are broken/lost/dissappear.
I wrote/modified a word-tips code (below) and it worked fine if I pointed it to one distinct file. It did not work when I tried to un-REM it back to the folder option. Probably because I left the open word doc portions REMed.
We also manually zipped a file, and then edited just the xml piece that contained the path for the embedded link. However in either case I have to do one by one.
Does anyone have macro code, or willing to post something, that would either do a mass find and replace running from some master vehicle word doc taht would do this to all target files in a directory with sub folders? Or, one that would zip all the target word docs, then find and replace/edit just the path portion of the link verbiage in the xml piece? Then save.
Anyone?
Public Sub MassReplace()
Dim Directory As String
Dim FType As String
Dim FName As String
Directory = "X:\Project files\TEST FOLDER\Facilities"
FType = "*.docx"
ChDir Directory
' FName = "X:\Project files\Facility\Project.docx"
FName = Dir(FType)
' for each file you find, run this loop
Do While FName <> ""
' open the file
'Documents.Open FileName:=FName
' search and replace the link server name
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "Fileserver"
.MatchCase = True
.Replacement.Text = "FS1"
End With
Selection.Find.Execute Replace:=wdReplaceAll
' save and close the current document
'ActiveDocument.Close wdSaveChanges
ActiveDocument.Save
' look for next matching file
FName = Dir
Loop
End Sub

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic