expression.NextRevision(Wrap)
expression 必需。该表达式返回一个 Selection 对象。
Wrap Variant 类型,可选。为 True 时则在到达文档尾部时继续从文档开始查找修订。默认值为 False。
如果没有发现有修订, 当前的选择区域保持不变。
本示例拒绝在活动文档第 5 段后发现的下一处修订。如果没有发现任何修订,变量 revTemp
设置为 Nothing。
Dim rngTemp as Range
Dim revTemp as Revision
If ActiveDocument.Paragraphs.Count >= 5 Then
Set rngTemp = ActiveDocument.Paragraphs(5).Range
rngTemp.Select
Set revTemp = Selection.NextRevision(Wrap:=False)
If Not (revTemp Is Nothing) Then revTemp.Reject
End If
如果下一处修订类型是插入文本,本示例将接受该修订。
Dim revTemp as Revision
Set revTemp = Selection.NextRevision(Wrap:=True)
If Not (revTemp Is Nothing) Then
If revTemp.Type = wdRevisionInsert Then revTemp.Accept
End If
本示例在当前选定内容后找到由文档作者制作的下一处修订。
Dim revTemp as Revision
Dim strAuthor as String
strAuthor = ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor)
Do While True
Set revTemp = Selection.NextRevision(Wrap:=False)
If Not (revTemp Is Nothing) Then
If revTemp.Author = strAuthor Then
MsgBox Prompt:="Another revision by " & strAuthor & "!"
Exit Do
End If
Else
MsgBox Prompt:="No more revisions!"
Exit Do
End If
Loop