>if (tr.Name == "StyleBlockName")
C# strings works as objects. You should use the String.CompareTo() method to compare a string variable/property to another string. Like this:
if (tr.Name.CompareTo("StyleBlockName") == 0)
HTH,
- Erik Niese-Petersen
Crazy Dane in USA.