gpt4 book ai didi

vba - Microsoft Word 宏来计算评论

转载 作者:可可西里 更新时间:2023-11-01 10:00:30 24 4
gpt4 key购买 nike

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

最佳答案

下面是一个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 Sub

关于vba - Microsoft Word 宏来计算评论,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11986842/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com