The problem: I want to modify a StyleRun after it’s been added to StyledText.
The documentation is a little unclear about this. The page for the StyleRun.Text property indicates that the text property can be set, but it seems like it can only be set before it’s been added to a StyledText object. The StyledText page says that “If you want to operate on a StyleRun, you must remove the old run and replace it with the new run.”
However, I’m running into issue when I try to remove an old run and replace it with a new one. I can add a new StyleRun to the end, but when I use StyledText.AddStyleRunAt, the program simply crashes without an error message.
The question: has anyone managed to successfully replace StyleRuns in a StyledText object?
Thank you all!