我是一名教学设计师;我通过添加注释来编辑word文档。我在问我是否可以找到一个单词宏来帮助我统计这些评论并对它们进行分类。感谢您的帮助
发布于 2012-08-17 13:32:17
这是一个根据你的分类来计算商品数量的Sub:
Sub CountComments()
Dim spelling, grammar, rephrasing, technical, other As Integer
spelling = 0
grammar = 0
rephrasing = 0
technical = 0
other = 0
Dim comment As comment
For Each comment In ActiveDocument.Comments
Dim firstWord As String
firstWord = Split(comment.Range.Text, " ")(0)
Select Case LCase(firstWord)
Case "spelling"
spelling = spelling + 1
Case "grammar"
grammar = grammar + 1
Case "rephrasing"
rephrasing = rephrasing + 1
Case "technical"
technical = technical + 1
Case Else
other = other + 1
End Select
Next
MsgBox _
"Spelling:" & spelling & _
"; Grammar:" & grammar & _
"; Rephrasing:" & rephrasing & _
"; Technical:" & technical & _
"; Other:" & other, , "Comment category summary"
End Subhttps://stackoverflow.com/questions/11986842
复制相似问题