View Single Post
 
Old 11-07-2018, 07:46 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,142
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could save the file in the compatibility mode of an earlier version that had the links available as described, then replace the path in the field, update the field and save it back in the compatibility mode of the current version. It should work fine provided you have not used any more recent features in the document, such as some content control types applicable only to later versions of Word.

Put the new path where indicated at the top of the macro and run the macro on a copy of your document.
Code:
Sub ChangeLink()
'Graham Mayor - http://www.gmayor.com - Last updated - 07 Nov 2018
Const NewPath As String = "C:\\Path\\"
Dim oFld As Field
Dim strCode As String
Dim vName As Variant
    ActiveDocument.SaveAs2 FileName:=ActiveDocument.FullName, CompatibilityMode:=11
    For Each oFld In ActiveDocument.Fields
        If oFld.Type = wdFieldIncludePicture Then
            vName = Split(oFld.Code, "\\")
            strCode = " INCLUDEPICTURE " & Chr(34) & NewPath & vName(UBound(vName))
            oFld.Code.Text = strCode
            oFld.Update
        End If
        ActiveDocument.SaveAs2 FileName:=ActiveDocument.FullName, CompatibilityMode:=Val(Application.Version)
    Next oFld
lbl_Exit:
    Set oFld = Nothing
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote