Sub InsertHyperlinks()
Dim arrExcelValues()
Dim arrExcelValues2()
Set ObjExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\Book1.xslx")
objExcel.visible = True
i = 1
x = 0
Do Until objExcel.Cells(i, 1).Value = ""
ReDim Preserve arrExcelValues(x)
arrExcelValues(x) = objExcel.Cells(i, 1).Value
i = i + 1
x = x + 1
Loop
x = x - 1
Dim FileName As String
Dim filePath As String
Dim fileExte As String
j = 1
y = 0
Do Until objExcel.Cells(j, 2).Value = ""
ReDim Preserve arrExcelValues2(y)
arrExcelValues2(y) = objExcel.Cells(j, 2).Value
j = j + 1
y = y + 1
Loop
objExcel.Quit
Dim xlApp As Object
For i = 0 To x
fileName = arrExcelValues(i)
fileExte = arrExcelValues2(i)
filePath = "C:\Test\" & fileName & fileExte
With Selection.Find
.Text = fileName
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindCOntinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSOundsLike = False
.MatchAllWordForms = False
Ends With
Selection.Find.Execute
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, Address:=filePath, SubAddress:="", ScreenTip:="", TextToDisplay:=Selection.Text
SetxlApp = Nothing
Next
End Sub