below macro counts the number of occurrences of bold formatting in a document. It is running fine on documents WITHOUT tables. As soon as there is a BOLD FORMATTED WORD within a TABLE, the macro falls into an endless loop.
How do I have to change the code to include also tables?
Help is much appreciated. Thank you very much in advance.
Dim rngStory As range
Dim i As Long
Set rngStory = ActiveDocument.StoryRanges(wdMainTextStory)
.Font.Bold = True
i = i + 1
If i > 0 Then
MsgBox "Occurrences of bold formatting found " & i & " time(s)."
MsgBox "No bold formatting found", vbOKOnly, "No bold formatting!"