none
Table of Contents in Sidebar RRS feed

  • Question

  • Is it possible to have a table of contents displayed in a text box instead of in the document layer?  I want the look of a sidebar on the front page of my document.  I am quite comfortable in VBA and am using Word 2010. 
    Thursday, July 5, 2012 5:46 PM

Answers

  • Thanks Stefan for answering. I tried to insert the TOC into a text box, but from the ribbon it is not enabled when I select the text box. How do you do it? Is there a way to do it from vba?


     

     
     
    You can insert the TOC field directly at the insertion point: Press Ctrl+F9; Word adds field delimiters, { }. Type TOC \o "1-3" \h (this creates an ordinary TOC with three heading levels and hyperlinks). Press F9 to update. You will have to manually add the right-aligned tab stop for the page number. You'll only have to this once for each level of TOC entries (because the TOC styles are set, by default, to update automatically).

    Stefan Blom, Microsoft Word MVP
    Friday, July 6, 2012 6:39 PM

All replies

  • Yes, in Word 2010 (and 2007, if I remember correctly), you can insert a TOC in a text box, but note that it won't be backward compatible.
    Stefan Blom, Microsoft Word MVP
    Thursday, July 5, 2012 7:02 PM
  • Thanks Stefan for answering.  I tried to insert the TOC into a text box, but from the ribbon it is not enabled when I select the text box.  How do you do it?  Is there a way to do it from vba? 

    Friday, July 6, 2012 2:37 PM
  • Thanks Stefan for answering. I tried to insert the TOC into a text box, but from the ribbon it is not enabled when I select the text box. How do you do it? Is there a way to do it from vba?


     

     
     
    You can insert the TOC field directly at the insertion point: Press Ctrl+F9; Word adds field delimiters, { }. Type TOC \o "1-3" \h (this creates an ordinary TOC with three heading levels and hyperlinks). Press F9 to update. You will have to manually add the right-aligned tab stop for the page number. You'll only have to this once for each level of TOC entries (because the TOC styles are set, by default, to update automatically).

    Stefan Blom, Microsoft Word MVP
    Friday, July 6, 2012 6:39 PM