DocX
DocX copied to clipboard
inserting a TC field
My overall goal is to merge several documents together, with a table of contents at the beginning with links to each document.
I can add the table of contents, and I can insert the documents, but I can't figure out how to create TC fields for the table of contents to use.
The table of contents is using the switch
TableOfContentsSwitches.F, "p"
but I need to be able to insert a field with the text TC ""{documentTitle}"" \f p at the beginning of each document before I insert it, and I can't see any way to do that.
Is this possible, and if so, how?
Hi, Upon further investigation, we currently do not offer a way of adding TC field in an MS Word document. We did however create a feature request for this in the future.
Maybe, the easiest way for you right now, would be to make sure each document to be merged starts with a known heading. This way the Table of Content would be able to list the different documents and link to them. You can set the heading of a paragraph easily with something like: paragraph.StyleId = "Heading1";
Thank you