Word Count in MS Word

I'm trying to have a text box or table that will count the number of words in that box/cell. I then need to use the word count in a math formula in the next column/text box. Also, is there a way to count bold words separately? This is for a newspaper and they need to know the word count for ads to come up with prices.

Thanks!!!!
tif

Comments

  • : I'm trying to have a text box or table that will count the number of words in that box/cell. I then need to use the word count in a math formula in the next column/text box. Also, is there a way to count bold words separately? This is for a newspaper and they need to know the word count for ads to come up with prices.
    :
    : Thanks!!!!
    : tif
    :

    [blue]
    Here is some code that will count the number of words highlighted in any document. A dialog box will appear with the number of words and the number of bold words. If you want this code sent to you in a word file then just give me your e-mail address and I will send it to you.

    [code]
    Public Sub CountWords()
    Dim rngCount As Range
    Dim rngBold As Range
    Dim intBoldCount As Integer

    Set rngCount = Selection.Range

    For Each rngBold In rngCount.Words
    If rngBold.Bold = True Then
    intBoldCount = intBoldCount + 1
    End If
    Next
    MsgBox "# of Words: " & rngCount.Words.Count & vbNewLine & _
    "# of Bold Words: " & intBoldCount
    End Sub
    [/code]
    [/blue]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion