Thanks to Jang's tip and further experimentation, I got this to work. In order to restore original formatting to a range of text, I had to store three things:
- The original text range
- A list of text items retrieved with FTI_CharPropsChange that show all the offsets where a format change takes place. This was where Jang was pointing.
- A master array of text PropVals objects, one for each location where a change took place.
The third is necessary because the text items do not contain the actual properties at the locations of change, only the offset where a change took place and a clue as to what changed. When it comes to restoring exactly what was there before, that clue is not of much use. So, I store a full PropVals list for each location of change.
Afterwards, it's just a matter of stepping through the text items, forming text ranges out of the offsets, and applying the corresponding PropVals list to the range. It is a little tricky to keep it all straight, but it works. Of course, if there is a single text change within the restoration range prior to the restoration, it all breaks down. But this is better than what I was working with.
Russ