![通过 vbscripting 验证 word 文档](https://linux22.com/image/1427592/%E9%80%9A%E8%BF%87%20vbscripting%20%E9%AA%8C%E8%AF%81%20word%20%E6%96%87%E6%A1%A3.png)
您认为 vba 能帮助我学习如何通过 vbscripting 验证 word 文档吗?或者我必须严格学习针对 word 文档的 vb 脚本。我的主要问题是我想从第 7 行开始验证,然后在完成后退出文档。我不想验证到文档末尾。请告诉我该怎么做。
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Open(strFilePath)
Set objSelection = objWord.Selection
For i =0 to 1
objSelection.Find.Text =Date 'Today's Date
objSelection.Find.Forward = TRUE
objSelection.Find.MatchWholeWord = TRUE
If objSelection.Find.Execute Then
Call Verification(True, True,"The search string was found."&i, "")
Else
Call Verification(True, False,"The search string was not found.", "")
End If
Next
objWord.Quit 0