Comment 对象

         
多种对象
Comments (Comment)
Range

代表单个批注。Comment 对象是 Comments 集合的一个元素。Comments 集合包括选定内容、区域或文档中的备注。

使用 Comment 对象

Comments(index) 可返回单个 Comment 对象,其中 index 是索引序号。索引序号代表该备注在选定内容、区域或文档中的位置。下列示例显示活动文档中第一个备注的作者。

MsgBox ActiveDocument.Comments(1).Author

Add 方法可在指定区域内添加备注。下列示例紧接着选定内容添加一条备注。

Selection.Collapse Direction:=wdCollapseEnd
ActiveDocument.Comments.Add Range:=Selection.Range, _
    Text:="review this"

Reference 属性可返回指定备注的引用标记。用 Range 属性可返回指定批注的文字。下列示例显示活动文档中第一条批注的文字。

MsgBox ActiveDocument.Comments(1).Range.Text