|
楼主 |
发表于 2021-12-28 09:15
|
显示全部楼层
您好,参考您给的代码,我加了一个文件夹的循环,以便能批量处理,
但是添加灰色底纹的效果还是有点偏差。第一页的第一行全部添加了底纹, "*** FLAPS 05 ***"没有进行添加
我把部分文档也发您一下,您可以帮我再看看吗?文档奇偶页的区别是"AIR COND AUTO", "AIR COND OFF"
Sub highlight()
Dim arr, i&
arr = Array("3.00 MM SLUSH", "*** FLAPS 05 ***", "AIR COND AUTO", "AIR COND OFF")
Dim k As FileDialog
Set k = Application.FileDialog(3)
k.Show
For Each j In k.SelectedItems
Documents.Open j
For i = 0 To UBound(arr)
With ActiveDocument.Content.Find
.ClearFormatting
.Text = arr(i)
.Forward = True
.MatchWildcards = True
Do While .Execute
With .Parent
.HighlightColorIndex = wdGray25
End With
Loop
End With
Next
ActiveDocument.Close SaveChanges:=wdSaveChanges
Next
End Sub
|
|