Updating table of contents python

Is this the only way to update the whole table of contents in a word. There are items that are not updated after running the below, is there something I’m missing or is there another way to update this?

doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC1).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC3).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC2).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC_HEADING).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC4).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC5).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC6).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC7).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC8).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOC9).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TOA_HEADING).font.name = ""
doc.styles.get_by_style_identifier(aw.StyleIdentifier.TABLE_OF_AUTHORITIES).font.name = ""

@Mark030 In your code it looks like you are trying to update TOC formatting. Is this your goal? If you need to update TOC field, you can call Document.update_fields(). Please see our documentation for more information:
https://docs.aspose.com/words/python-net/working-with-table-of-contents/

I’m try to update the font style of all TOC

@Mark030 In this case you should updated TOC1.....TOC9 styles in the document. If there are problems with this, Please attach your input, output and expected output documents here for testing.

There are formats that the TOC1-TOC9 are unable to change. not sure why. but was able to already do it by iterating runs per paragraph in the TOC. thanks

@Mark030 It is perfect that you managed to achieve what you need. But, please note, if you explicitly set formatting of Run nodes in the TOC, the formatting of the TOC might be reset after updating TOC in MS Word.