Try the following:
Sub WordCount()
Dim i As Long, b As Long, c As Long, t As Long
With ActiveDocument
For i = 1 To .Tables.Count
t = t + .Tables(i).Range.ComputeStatistics(wdStatisticWords)
Next
For i = .Fields.Count To 1 Step -1
If .Fields(i).Type = wdFieldBibliography Then b = .Fields(i).Result.ComputeStatistics(wdStatisticWords): Exit For
Next
If .TablesOfContents.Count = 1 Then c = .TablesOfContents(1).Range.ComputeStatistics(wdStatisticWords)
i = 0: If .Indexes.Count = 1 Then i = .Indexes(1).Range.ComputeStatistics(wdStatisticWords)
MsgBox "There are " & .Range.ComputeStatistics(wdStatisticWords) & " words in the document body, including:" & vbCr & _
c & " words in the Table of Contents;" & vbCr & _
t & " words in tables;" & vbCr & _
i & " words in the Index; and" & vbCr & _
b & " words in the Bibliography."
End With
End Sub
Note: The macro assumes you're using Word's built-in Table of Contents, Index and Bibliography tools, not 3rd-party products for these. Content in headers, footers, endnotes, footnotes, and shape-like objects in the document body is not counted.
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing\_macro.htm
For Mac macro installation & usage instructions, see: https://wordmvp.com/Mac/InstallMacro.html