+ -
当前位置:首页 → 问答吧 → 若文档A的第一句不等于文本B的第一句

若文档A的第一句不等于文本B的第一句

时间:2010-12-17

来源:互联网

local]1[/local]

若文档A的第一句不等于文本B的第一句,则把文本B中的第一句突出显示。

怎么办?

附件

文档.rar(7.05 KB)

2010-12-17 20:05, 下载次数: 2

作者: 观自性   发布时间: 2010-12-17

复制内容到剪贴板
代码:
Sub test()
Dim temp$
Application.ScreenUpdating = False
ThisDocument.Sentences(1).HighlightColorIndex = wdAuto
temp = ThisDocument.Path & "\文档A.doc"
Documents.Open FileName:=temp, Visible:=False
If Documents("文档A.doc").Sentences(1) <> ThisDocument.Sentences(1) Then ThisDocument.Sentences(1).HighlightColorIndex = wdYellow
Documents("文档A.doc").Close False
Application.ScreenUpdating = True
End Sub
粘贴到文档B里

作者: honggexjq   发布时间: 2010-12-17