你能以编程方式确定Word中是否启用了现代评论吗?

huangapple go评论81阅读模式
英文:

Can you programmatically determine if modern comments are enabled in Word?

问题

你能够以编程方式确定 Word 中是否启用了现代评论吗?

如果直接检查这一点不可能[我认为不可能],是否有评论的属性可以检查,以指示它是否是使用现代评论添加或编辑的?它需要包括最初以旧样式添加,然后使用现代评论进行编辑的评论。

英文:

Can you programmatically determine if modern comments are enabled in Word?

If it is not possible to check this directly [I don't think it is], is there any property of a comment that you can check that will indicate whether it was added or edited using modern comments? It would need to include comments that were originally added in the old style, but then edited using modern comments.

答案1

得分: 1

尝试使用 Comments 集合的 Counts 属性:

ActiveDocument.Comments.Count

使用 Comment.Range 属性,该属性返回一个表示评论内容的 Range 对象。例如:

With ActiveDocument.Comments(1).Range 
 .Delete 
 .InsertBefore "新评论文本"
End With

查看更多信息,请参阅重新设计的 Word 评论 VBA 弃用公告

英文:

Try to use the Counts property of the Comments collection:

ActiveDocument.Comments.Count

Use the Comment.Range property which returns a Range object that represents the contents of a comment. For example:

With ActiveDocument.Comments(1).Range 
 .Delete 
 .InsertBefore "new comment text" 
End With

See Redesigned Word Comments VBA deprecation announcement for more information.

huangapple
  • 本文由 发表于 2023年7月31日 21:22:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76804070.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定