View Single Post
 
Old 11-05-2019, 02:36 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Dita

If you want to learn to code for exceptions you need to study code already on this forum to see how people have dealt with issues. For instance, a good example of dealing with table content and exceptions can be seen in this thread https://www.msofficeforums.com/word-...ll-tables.html

The code Graham provided is very simplistic and provides a 'test' but doesn't selectively apply formatting to the non-hyperlink parts of the selection. It is an 'all or nothing' approach which looks to see if there are ANY hyperlinks in the selection and if not, formats the whole selection. To apply the colour to chunks of the selection which aren't hyperlinks requires a lot more code and could be approached in few different ways. Probably the easiest would be to format everything selected as red and then loop through any hyperlinks and turn them back to your preferred colour.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote