Suppose I have a Range
reference in Word VBA, and I want to break that down into smaller ranges where the formatting (font, colour, etc.) is identical. For example, if I start with:
The quick brown fox jumped over the lazy dog.
...then I would want to get back 5 ranges, as follows:
The
quick
brown fox jumped over the
lazy
dog.
I had hoped that there was a built-in way to do this in VBA (and even have a phantom memory of using such a facility), but I can't find anything.
I could do what I need to do in code, but something that works natively would be much (much) quicker.
[In code, I would use the fact that - for example - oRange.Font.Bold
will return "undefined" if the range contains a mix of bold and not bold, and so I could use this repeatedly to discover the extent of the uniform ranges. But I'm pretty sure that Word will be doing this under the hood, so if someone can pop that hood for me, I'd be grateful.]
EDIT: removed more complex example that the StackOverflow HTML renderer did not like.