ActiveDocument.Content.Select
With Selection.Find
.ClearFormatting
.Text = "重量"
.Font.NameFarEast = "黑体"
.Forward = True
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
MsgBox "找到!"
Else
MsgBox "没找到!"
End If
With Selection.Find
.ClearFormatting
.Text = "重量"
.Font.NameFarEast = "黑体"
.Forward = True
End With
Selection.Find.Execute
If Selection.Find.Found = True Then
MsgBox "找到!"
Else
MsgBox "没找到!"
End If
这段内容是一段代码,主要功能是在活动文档中查找“重量”一词。先选中活动文档内容,设置查找格式,指定查找文本为“重量”,字体为黑体,向前查找,执行查找操作后,根据查找结果弹出相应提示框。
1294

被折叠的 条评论
为什么被折叠?



