您认为 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