yep so now instead of counting the words in the selected text, i count the sentences and search through each sentence for a comma and display how many times a comma occured in each sentence (is 1 comma in first sentence, 0 in second etc) , i thought i'd use the same findChar function as before:
VB Code:
  1. Private Function findChar(Text As String, myChar As String) As Integer 'Returns a Integer value
  2.  
  3.     Dim counter As Integer
  4.     Dim iPos As Integer
  5.  
  6.     counter = 0
  7.     iPos = 0
  8.     iPos = InStr(1, Text, myChar)
  9.     Do While iPos > 0
  10.         iPos = InStr(iPos, Text, myChar)
  11.         If iPos > 0 Then
  12.             iPos = iPos + 1
  13.             counter = counter + 1
  14.         End If
  15.     Loop
  16.    
  17.     findChar = counter
  18.    
  19. End Function
And then call it from the main program as this:
VB Code:
  1. 'Prints out sentences highlighted
  2.         Dim sentenceCount As Integer
  3.         Dim newCount As Integer
  4.        
  5.         'Gets number of all sentences selected
  6.         sentenceCount = Selection.Sentences.count
  7.         newCount = sentenceCount - 1
  8.        
  9.         'If sentenceCount > 0 Then
  10.        '       MsgBox "Sentences selected = " & newCount
  11.         '     Else
  12.         '     MsgBox "Sentences selected = 0"
  13.           '   End If
  14.           Do While sentenceCount > 0  'if sentence highlighted
  15.                commaCount = findChar(myText, ",")  'find comma
  16.                   sentenceCount = sentenceCount - 1 'suppose to iterate
  17.                Loop
  18.                     MsgBox "commas found in  sentence" & sentenceCount     & "equals " & commaCount  'but only comes out with total number of comma's in all sentences

??