View Single Post
 
Old 11-10-2017, 06:46 AM
ndw ndw is offline Windows 10 Office 2016
Novice
 
Join Date: Nov 2017
Posts: 1
ndw is on a distinguished road
Default Updating links while merging Word documents

Hi,

i have different Word documents in a folder, which i merge using this code.


Code:
Sub MergeDocs()     
     Dim rng As Range     
     Dim MainDoc As Document      
     Dim strFile As String
     Const strFolder = "C:\Book\Chapters\" 'change  to suit
     Set MainDoc = Documents.Add
     strFile = Dir$(strFolder  & "*.doc") ' can change to .docx
      Do Until strFile = ""
          Set rng = MainDoc.Range
         rng.Collapse wdCollapseEnd
          rng.InsertFile strFolder & strFile
         strFile = Dir$()     
     Loop  
End Sub
But, all Word documents have links to Excel files and the word document is updated when opening.
Is it possible to add some code so that when merging, the links are updated
thanks
Reply With Quote