简体   繁体   English

VBA宏字注释

[英]VBA macro word comment

I'm new to VBA macros for word. 我是VBA宏的新手。 I need to alter an exciting macro operating on comment in word. 我需要更改一个令人兴奋的宏,以词为基础进行评论。 I need to add the comment reference to a string. 我需要将注释引用添加到字符串。 What is call the comment reference is the string inside the square brackets, here SM4: 所谓的注释引用是方括号内的字符串,此处为SM4:

link to image http://dl.dropbox.com/u/13765664/wordcomment.png 链接到图片http://dl.dropbox.com/u/13765664/wordcomment.png

How do i get the comment reference? 我如何获得评论参考?

I'm fairly clueless re Word coding, but this seems to do what you want: 我对Word编码一无所知,但这似乎可以满足您的要求:

Dim ocom As Comment
For Each ocom In ActiveDocument.Comments
    With ocom
        MsgBox .Author & vbCrLf & .Initial
        MsgBox .Range.Text
    End With
Next

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM