{"id":2288,"date":"2016-02-04T12:33:58","date_gmt":"2016-02-04T12:33:58","guid":{"rendered":"http:\/\/www.ericwhite.com\/home2\/bm8qcmjy\/public_html\/blog\/?page_id=2288"},"modified":"2016-03-20T09:40:59","modified_gmt":"2016-03-20T09:40:59","slug":"exploring-tables-of-contents-in-open-xml-wordprocessingml-documents-part-2","status":"publish","type":"page","link":"https:\/\/www.ericwhite.com\/blog\/exploring-tables-of-contents-in-open-xml-wordprocessingml-documents-part-2\/","title":{"rendered":"Exploring Tables-of-Contents in Open XML WordprocessingML Documents (Part 2)"},"content":{"rendered":"<p><span class=\"Back\"><a class=\"Back\" href=\"https:\/\/www.ericwhite.com\/blog\/introduction-to-wordprocessingml-series\/\">Return to the WordprocessingML Screen-Cast Series<\/a><\/span>Many Open XML developers need to generate documents, and then generate and insert an updated table-of-contents for the document.&nbsp; TOC&#39;s in Open XML are not hard, but they require a bit of explanation.&nbsp; This post introduces the second in a series of screen-casts around Open XML WordprocessingML TOCs.<\/p>\n<p>In the <a href=\"http:\/\/openxmldeveloper.org\/home2\/bm8qcmjy\/public_html\/blog\/b\/openxmldeveloper\/archive\/2011\/08\/08\/exploring-tables-of-contents-in-open-xml-wordprocessingml-documents.aspx\">first screen-cast<\/a>, I explored the markup for a TOC, discussed the &lt;w:updateFields&gt; element in the settings part, and showed Word&#39;s behavior when that field is set.<\/p>\n<p>In this second screen-cast, I discuss a bit more about the markup, and then walk through some example code that is part of the PowerTools for Open XML project.&nbsp; The example code shows how to insert a TOC at a desired point in a document, and then set the &lt;w:updateFields&gt; element.&nbsp; Then, when&nbsp;the user next&nbsp;opens that document, Word will present them with the option to repaginate and update the TOC.<\/p>\n<p>As part of the definition of each TOC, you specify a set of switches that Word uses as instructions on how to construct the TOC.&nbsp; This screen-cast discusses the TOC switches, and shows how to find out more about them from the text of the Open XML standard.<\/p>\n<p><iframe loading=\"lazy\" title=\"TocAdder2.wmv\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/qhsVNV8uFUk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<div><a href=\"https:\/\/www.ericwhite.com\/blog\/wp-content\/uploads\/2016\/03\/TocAdder.zip\">Download &#8211; Exploring Tables-of-Contents in Open XML WordprocessingML Documents (Part 2)<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Return to the WordprocessingML Screen-Cast SeriesMany Open XML developers need to generate documents, and then generate and insert an updated table-of-contents for the document.&nbsp; TOC&#39;s in Open XML are not hard, but they require a bit of explanation.&nbsp; This post introduces the second in a series of screen-casts around Open XML WordprocessingML TOCs. In the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_s2mail":"","footnotes":""},"class_list":["post-2288","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/comments?post=2288"}],"version-history":[{"count":3,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2288\/revisions"}],"predecessor-version":[{"id":2589,"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/pages\/2288\/revisions\/2589"}],"wp:attachment":[{"href":"https:\/\/www.ericwhite.com\/blog\/wp-json\/wp\/v2\/media?parent=2288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}