在 Microsoft Word 中展开评论选择

ahs*_*ele 8 microsoft-office microsoft-office-2010 microsoft-word microsoft-word-2010

在 Microsoft Word 中是否可以扩展选定的评论区域?这意味着您之前已经指定了一个评论,但现在想要扩展该评论​​的选择。

作为使以下评论起作用的示例,我必须删除评论,然后添加新评论。我宁愿只是扩大选择。

替代文字

Jon*_*erg 2

我通常只是将评论文本复制到剪贴板,删除评论,然后为正确的文本创建新评论。

以下宏可自动执行此操作:

Sub enlarge_comment()
 'assumes that the current selection contains just one comment!
 Dim newrange As Range
 Set newrange = Selection.Range
 Selection.Comments(1).Range.Copy       'copy text of old comment
 Selection.Comments.Add Range:=newrange 'create new comment
 Selection.Paste                        'add text to new comment
 newrange.Comments(1).Delete            'delete old comment
End Sub
Run Code Online (Sandbox Code Playgroud)

我使用剪贴板来确保注释的格式(例如不同的字体)不会丢失,但我还没有测试是否有更简单的方法。结果是这样的:

显示宏之前/之后的屏幕截图

当然,您可能想添加某种错误处理;如果所选区域中有多个注释,则它将采用 Word 认为是第一个注释的注释。此外,您的新选择需要完全包含旧选择;否则Selection.Comments为空并Selection.Comments(1).Range.Copy失败。