Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to produce a table of contents looking like this :

Heading 1 ........................................... p. 1
    Subheading 1 -- p. 1, Subheading 2 -- p. 3, Subheading 3 -- p. 4,
    Subheading 4 -- p. 4, Subheading 5 -- p. 6
Heading 2 ........................................... p. 7
    Subheading 1 -- p. 7, Subheading 2 -- p. 8, Subheading 3 -- p. 8,
    Subheading 4 -- p. 10, Subheading 5 -- p. 11
Heading 3 .......................................... p. 12

And so on, in Word 2007.

Any ideas how I could achieve this? My current toc is generated using {TOC \o "1-3" \h \z \u}. I imagine the \p switch would work, assuming that I could restrict it to level-2 headings.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I'm afraid you can't do anything like this. You would quickly run into the limitation that a TOC in Word inserts each entry as a separate paragraph, so that would make the second level of the TOC almost impossible to construct.

The only way to achieve this would be to create a macro which generates such a TOC for you. In other words when it's run it would iterate through each heading paragraph in the document and insert a TOC like you want for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.