This project has moved. For the latest updates, please go here.

Richtext format carry over

Apr 25, 2014 at 2:31 PM
Edited Apr 28, 2014 at 3:15 PM
Is there any reason, why ExcelRichTextCollection carries the current format over to the next chunk of text?
var rtfCollection = worksheet.Cells[1, 1].RichText
var red = rtfCollection.Add("Red");
red.Color = Color.Red;
Now the Text "Black" appears in red - even though I did not make any change to the rtfCollection directly, but only to the text that has been added to the collection.
This makes it very hard to write clean code: When passing the rtfCollection to a method in order to add some text, there is no way of knowing, which format-parameters it changes.
And when I add some text on my own afterwards, I need to reset each an every format-parameter just to be sure that I undid every change the method might have made.
Is there any way to make this easier?