You can use the following code to do this job. As it makes use of the Dictionary object, you need to add a reference to Microsoft Scripting Runtime to run this program.
___
[tt]
Private Sub Form_Load()
Dim dic As Dictionary, N As Integer
Set dic = GetWordStats("C:\sample.txt"

'Print statistics in debug pane.
For N = 0 To dic.Count - 1
Debug.Print dic.Keys(N), dic.Items(N)
Next
Unload Me
End Sub
Function GetWordStats(FileName As String) As Dictionary
'Read the contents of the file.
Dim FileNum As Integer, S As String
FileNum = FreeFile
Open FileName For Binary Access Read As #FileNum
S = Space$(LOF(FileNum))
Get #FileNum, , S
Close #FileNum
'Remove ALL punctuation and paragraph marks
'which do not represent/make words
Dim N As Integer
For N = 1 To 127
Select Case Chr$(N)
Case "A" To "Z", "a" To "z", "0" To "9"
Case Else
S = Replace$(S, Chr$(N), " "

End Select
Next
'Convert the string into array of words
Dim Words() As String
Words = Split(S)
'Now count occurence of each word individually
Dim WordStats As New Dictionary
Dim Word As Variant
WordStats.CompareMode = TextCompare
For Each Word In Words
If Len(Word) Then
'if word exists then
If WordStats.Exists(Word) Then
'increment the appearence count
WordStats(Word) = WordStats(Word) + 1
Else
'add a new word to the dictionary
WordStats.Add Word, 1
End If
End If
Next
'Return this dictionary
Set GetWordStats = WordStats
End Function
[/tt]