ישר כח ל@pcinfogmach על העזרה באישי הנה הקוד שיצא לי
Sub גיש_לקובץ_Excel()
Dim xlApp As Object
Dim xlWorkbook As Object
Dim xlWorksheet As Object
ActiveDocument.TrackRevisions = True
' פתח אפליקציה של Excel
Set xlApp = CreateObject("Excel.Application")
' פתח את הקובץ Excel
Set xlWorkbook = xlApp.Workbooks.Open("F:\ערוך\החלפות.xlsx")
xlApp.Visible = True
' בחר את גליון העבודה שבו נמצאים הנתונים
Set xlWorksheet = xlWorkbook.Sheets("גיליון4")
' קרוא את הנתונים מתאים בגליון העבודה
Dim data1 As String
Dim data2 As String
Dim data3 As Boolean
Dim i
i = 2
Do While xlWorksheet.Cells(i, 1).Value <> ""
data1 = xlWorksheet.Cells(i, 1).Value ' קורא את A
data2 = xlWorksheet.Cells(i, 2).Value ' קורא את B
data3 = xlWorksheet.Cells(i, 3).Value ' קורא את C
exchange data1, data2, data3
i = i + 1
Loop
' סגור את הקובץ Excel
xlWorkbook.Close
Set xlWorkbook = Nothing
' סגור את אפליקצית Excel
xlApp.Quit
Set xlApp = Nothing
End Sub
Public Function exchange(d1 As String, d2 As String, d3 As Boolean)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = d1
.Replacement.Text = d2
.Forward = True
.Wrap = wdFindContinue
.MatchWildcards = d3
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Function