如何在 word 文档中搜索文本并检查相同文本的下划线。谁能帮我吗??
Sub Underline()
Dim fnd As String
Dim n As Long
fnd = InputBox("Enter text to search" & vbCr & vbCr _
& "Click OK to search the entire workbook for all instances of the search text.")
Dim x As Integer
x = 0
Do While x = 0
With Selection.Find
.ClearFormatting
End With
If fnd = False Then
x = 1
Exit Do
End If
Selection.Find.Execute
If .Underline = False Then
Selection.Comments.Add Range:=Selection.Range, Text:="pls underline text"
Selection.Find.Execute
End If
Loop
End Sub