

- How to create table of contents in word 2010 automatically how to#
- How to create table of contents in word 2010 automatically pdf#
This has all the info with respect to adding and updating a TOC (am much more). The advice for anyone interested is to watch the 5-part screen-cast by Eric White - Exploring Tables-of-Contents in Open XML WordprocessingML Documents. I don't want to give an answer to my own question, but this is just to illustrate the steps that I’ve taken.
How to create table of contents in word 2010 automatically pdf#
If you need generate pdf file from docx, it's working fine! PPr.ParagraphStyleId = new ParagraphStyleId() ) Set Heading public static Paragraph SetHeading1(this Paragraph p)
How to create table of contents in word 2010 automatically how to#
Especially, I think youshould pay your attention to 5th one - " Shows how to use an AutoOpen macro to update the TOC whenever any document that contains a TOC is opened".Īll of that look a bit tricky, but I hope that helps. There are a few options to do that - see screen-casts 3-5 fromthe link to Eric White post I provided above.

In addition you will need provide the mechanism that will auto update TOC once the data are flushed (or once the document is opened).Then you programmatically flush all the data you need to this DOCX file and save it.Then you save this file and open it in OpenXML SDK 2.0 Tool, which provides you with the C# code to generate such empty file with TOC placeholder inside.You manually create an empty DOCX file and insert TOC inside it.MSDN forum thread: How can i Create dir for word document.īased on our comments below I could propose to use this scenario: MSDN forum thread: Generating Table of Contents and Applying a Custom Style, Reflector component in Open XML SDK Productivity Tool to see how to But you can generateĪ small TOC through Word app, and reflect the TOC parts with Document Open XML SDK 2.0 does not have this feature supported. Have a look at Fourth and Final Screen-Cast in Series on Adding/Updating the TOC in OpenXML WordprocessingML Documents by Eric White.Īccording FAQ from MSDN Forums I see that this feature is not supported:Ĩ) How to generate TOC (table of contents) in Word document?
