Extract ranges with same formatting (e.g. color, bold, font, ...)

M

mhi

Hi,

I want to extract ranges from a paragraph which have the same
formatting. At the moment I solve this problem iterating over all
characters in a paragraph and comparing their formatting(font, color,
bold, italic, ...). Groups of consecutive characters with the same
formatting build a range. The result of my algorithm is a list of
these ranges.
But this is tooooo slow.
Does anyone knows a possibility to extract these ranges in another
way? Is there a substructure under the paragraph object containing
such an info?


Thanks,
Martin
 
M

MSizlak

It might depend on how complex your format specs are. But
for example: if you simply do a find for italics
(font.italic=true), it will find each contiguous range of
characters that are italic.

Moe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top