首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于计算注释的Microsoft Word宏

用于计算注释的Microsoft Word宏
EN

Stack Overflow用户
提问于 2012-08-16 20:10:55
回答 1查看 2.2K关注 0票数 2

我是一名教学设计师;我通过添加注释来编辑word文档。我在问我是否可以找到一个单词宏来帮助我统计这些评论并对它们进行分类。感谢您的帮助

EN

回答 1

Stack Overflow用户

发布于 2012-08-17 13:32:17

这是一个根据你的分类来计算商品数量的Sub

代码语言:javascript
复制
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 Sub
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11986842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档