Hi,
I am trying to get a macro to count the words in various sections of a document, but not including the footnote and and note count. Right now i found this on another website and it does what I need but does not remove footnotes and endnotes. Does anyone know how to do that?
Sub WordCount()
Dim NumSec As Integer
Dim S As Integer
Dim Summary As String
NumSec = ActiveDocument.Sections.Count
Summary = "Word Count" & vbCrLf
For S = 1 To NumSec
Summary = Summary & "Section " & S & ": " _
& ActiveDocument.Sections(S).Range.Words.Count _
& vbCrLf
Next
Summary = Summary & "Document: " & _
ActiveDocument.Range.Words.Count & " " & Footnotes
MsgBox Summary
Selection.TypeText Text:=Summary
End Sub
I am trying to get a macro to count the words in various sections of a document, but not including the footnote and and note count. Right now i found this on another website and it does what I need but does not remove footnotes and endnotes. Does anyone know how to do that?
Sub WordCount()
Dim NumSec As Integer
Dim S As Integer
Dim Summary As String
NumSec = ActiveDocument.Sections.Count
Summary = "Word Count" & vbCrLf
For S = 1 To NumSec
Summary = Summary & "Section " & S & ": " _
& ActiveDocument.Sections(S).Range.Words.Count _
& vbCrLf
Next
Summary = Summary & "Document: " & _
ActiveDocument.Range.Words.Count & " " & Footnotes
MsgBox Summary
Selection.TypeText Text:=Summary
End Sub