View Single Post
 
Old 06-09-2022, 08:29 AM
rollis13's Avatar
rollis13 rollis13 is offline Windows 10 Office 2016
Competent Performer
 
Join Date: Jan 2021
Location: Cordenons
Posts: 142
rollis13 will become famous soon enough
Default

Probably, since hyperlinks are 'fields' when you test the first character it picks the entire field returning '9999999 (hex 98967F) = undefined Font.Color' since the field has more colors.
Add these 2 lines and deactivate the other 2, run the macro and see the result in the "Immediate Window" Ctrl+G
Code:
'...
strHex2 = Hex(char.Font.Color)
cnt = cnt + 1                         '<- added
Debug.Print cnt & " = " & char.Font.Color & " = " & strHex2 '<- added
strHex3 = Hex(char.Style.Font.Color)
'...
'bFound = True                     '<- deactivated
'GoTo nt_lb                        '<- deactivated
'...