الحمد لله سبحانه وتعالى..، أشكرك شكرا جزيلا يا فندم
كنت أتنمنى ألا يوجد مربع حوار.. مثل مربع حوار البحث والاستبدال... لأن عدد الكلمات التي يتم تصحيحها كثير جدا في بروفات الكتب كثير جدا
المهم أنني أخذت بعض الإجراءات من بعض الماكروها المتنوعة من النت...
عملت شيئا قريبا مما كنت أحتاجه..، واسمح لي أن أضعه لعل الإخوة يستفيدوا به إن شاء الله تعالى:
Sub ReplaceFromTableL()
Dim ChangeDoc, RefDoc As Document
Dim cTable As Table
Dim oFind, oReplace As Range
Dim i As Long
Dim sFname As String
'Identify the document containing the table of words/phrases and their replacements
sFname = "D:\M_Rajab\changes.docx"
'Identify the document to be processed
WordBasic.TextToTable ConvertFrom:=1, NumColumns:=2, NumRows:=1, _
InitialColWidth:=wdAutoPosition, Format:=0, Apply:=1184, AutoFit:=1, _
SetDefault:=0, Word8:=0, Style:="Table Grid"
ActiveDocument.Tables(1).Borders.Enable = True
Set RefDoc = ActiveDocument
'Open the document with the changes
Set ChangeDoc = Documents.Open(sFname)
'Identify the table to be used
Set cTable = ChangeDoc.Tables(1)
'Activate the document to be processed
RefDoc.Activate
For i = 1 To cTable.Rows.Count
'Identify the cell containing the word/phrase to be replaced
Set oFind = cTable.Cell(i, 1).Range
oFind.End = oFind.End - 1
'Identify the cell containing the replacement word/phrase
Set oReplace = cTable.Cell(i, 2).Range
oReplace.End = oReplace.End - 1
With selection
'Start at the top of the document
.HomeKey wdStory
'Replace the words/phrases
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Execute findText:=oFind, _
ReplaceWith:=oReplace, _
Replace:=wdReplaceAll, _
MatchWholeWord:=True, _
MatchWildcards:=False, _
MatchCase:=True, _
Forward:=True, _
Wrap:=wdFindContinue
End With
End With
Next i
ActiveDocument.Tables(1).Rows(1).Delete
If ActiveDocument.Saved = False Then ActiveDocument.Save
'Close the document with the table
'ChangeDoc.Close wdDoNotSaveChanges
End Sub
حياكم الله جميعًا..، والسلام عليكم ورحمة الله وبركاته