Hi folks,
This is actually a Word macro, but I guess the VBA principle is the same. This is what I have - it counts all highlighted words in a document:
Sub countWordsHighlightedYellow()
Dim highlightCount
highlightCount = 0
For Each w In ActiveDocument.Words
If w.HighlightColorIndex = wdYellow Then
'w.Delete
highlightCount = highlightCount + 1
End If
Next
MsgBox ("There are " & highlightCount & " words highlighted yellow.")
End Sub
The thing is that instead of counting hyperlinks (entered as text) as a SINGLE word, like standard wordcount in the MS Word does, it counts every item in the hyperlink. So for example,
would be counted as 5 words.
(it also counts this "pears/apples" as three words, instead of two but that's not so much of an issue).
Basically, is there a way to tell the Macro to count hyperlinks (underlined words) as a SINGLE word?
Any help is appreciated.
Bookmarks