The scenario is possible, although you should be aware RadWordsProcessing doesn't genuinely support table of content fields at this point. This means that you can add the field in the document, but you'd need to count on the consumer (e.g. MS Word or another viewer supporting DOCX documents) to update the field to its result.
As to the steps you need to execute, here is what I would suggest:
1. Import each HTML fragment with the HtmlFormatProvider
. This would produce a RadFlowDocument
2. Merge the documents with the Merge() method
. By default this appends them together in separate sections and allows some additional handling of the styles.
3. Insert a TOC field through the approach explained in the CustomCodeField article
. Make sure to set the IsDirty
property to true, since it is the one that specifies the viewer should update the field.
4. Export to DOCX through DocxFormatProvider
I hope this is useful.