-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChangeCheck.bas
31 lines (23 loc) · 967 Bytes
/
ChangeCheck.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Attribute VB_Name = "ChangeCheck"
Sub ChangeCheck()
Dim given, currentauthor As String
Dim countChg, countComm, totalChg, totalComm, counter, wordcount As Long
given = InputBox("Please type the username of the editor you wish to evaluate.")
wordcount = ActiveDocument.Range.ComputeStatistics(wdStatisticWords)
totalChg = 0
countChg = ActiveDocument.Range.Revisions.Count
countComm = ActiveDocument.Range.comments.Count
For counter = 1 To countChg
currentauthor = ActiveDocument.Range.Revisions(counter).Author
If currentauthor = given Then
totalChg = totalChg + 1
End If
Next counter
For counter = 1 To countComm
currentauthor = ActiveDocument.Range.comments(counter).Author
If currentauthor = given Then
totalComm = totalComm + 1
End If
Next counter
MsgBox "Editor name: " & given & vbCrLf & "Changes by this editor: " & totalChg & vbCrLf & "Comments by this editor: " & totalComm
End Sub