Generating a Table from Styles in the Header

J

jerem

Does anyone know how I can generate a Table of Contents using Header 1 styles
(or any styles) in a Header. Here's the gist of what I need: Usually you
generate a TOC from either Heading Styles or Numbering Scheme styles in the
main body of the document. The information I need for the TOC resides in the
headers, not the body of the text. I styled the areas in the Header that I
need for the TOC, however, the TOC comes back saying something on the line of
"there are no entries for the TOC" which tells me that it is not even looking
into the Headers. Any way of resolving this or getting around this somehow?

Thanks in advance for your help.
 
P

Pamelia Caswell via OfficeKB.com

Unfortunately, the TOC cannot read the header/footer layers. Perhaps you
should rethink your layout.

Pam
 
D

DeanH

jerem: As Pamelia has mentioned the TOC will not read the header/footer
layers, you have to have the Headings in the document body layer, then the
TOC will capture the required information.
If you require the Heading information repeated in the Header/Footer and to
change as sections change use the StyleRef function (see
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm).
This will negate the requirement of the many section breaks you probably
have in your document as StyleRef will autoamatcially change as a new Heading
appears in the document and does not need a section break, unlinking of
Header/Footer, etc.
Hope this helps
DeanH
 
J

jerem

Since you mention StyleRef ... I tried using a StyleRef code to grab things
out of the header, that doesn't work either. Apparently you can grab text
out of the body of the document with StyleRef and move it into a footer, but
not vice versa. Bummer! The document I have to work with is 230 pages and
the deadline is drawing near - don't have time to restructure the entire
document. Was hoping there was a way to get around this, but thanks for the
info.
 
P

Peter T. Daniels

How did you get the many different items into the headers in the first
place? Maybe there's a way to automate fixing them. (Which version of
Word?)
 
J

jerem

It's a long story about that, but it turns out I ended up coming up with a
solution. I ended up marking the areas with bookmarks and then I used the
{REF Bookmark} field code to generate a TOC. That did the trick!


Peter T. Daniels said:
How did you get the many different items into the headers in the first
place? Maybe there's a way to automate fixing them. (Which version of
Word?)

Since you mention StyleRef ... I tried using a StyleRef code to grab things
out of the header, that doesn't work either. Apparently you can grab text
out of the body of the document with StyleRef and move it into a footer, but
not vice versa. Bummer! The document I have to work with is 230 pages and
the deadline is drawing near - don't have time to restructure the entire
document. Was hoping there was a way to get around this, but thanks for the
info.



DeanH said:
jerem: As Pamelia has mentioned the TOC will not read the header/footer
layers, you have to have the Headings in the document body layer, then the
TOC will capture the required information.
If you require the Heading information repeated in the Header/Footer and to
change as sections change use the StyleRef function (see
http://sbarnhill.mvps.org/WordFAQs/StyleRef.htm).
This will negate the requirement of the many section breaks you probably
have in your document as StyleRef will autoamatcially change as a new Heading
appears in the document and does not need a section break, unlinking of
Header/Footer, etc.
Hope this helps
DeanH
"Pamelia Caswell via OfficeKB.com" wrote:
Unfortunately, the TOC cannot read the header/footer layers. Perhaps you
should rethink your layout.

jerem wrote:
Does anyone know how I can generate a Table of Contents using Header 1 styles
(or any styles) in a Header. Here's the gist of what I need: Usually you
generate a TOC from either Heading Styles or Numbering Scheme styles in the
main body of the document. The information I need for the TOC resides in the
headers, not the body of the text. I styled the areas in the Header that I
need for the TOC, however, the TOC comes back saying something on the line of
"there are no entries for the TOC" which tells me that it is not even looking
into the Headers. Any way of resolving this or getting around this somehow?
Thanks in advance for your help.
 
S

Stefan Blom

I'm guessing you created a TOC without page numbers, then? I don't see how
you could get accurate page numbers for bookmarked items in a header (or
footer for that matter).

--
Stefan Blom
Microsoft Word MVP



jerem said:
It's a long story about that, but it turns out I ended up coming up with a
solution. I ended up marking the areas with bookmarks and then I used the
{REF Bookmark} field code to generate a TOC. That did the trick!
 
J

jerem

That's right. I didn't need page numbers in the TOC. What I needed was a
TOC-like index which included listing a Form No. and a Title Description.
What I was working with was a 230 page manual that had Form Numbers, Title
Descriptions, {Page} and {SectionPages} codes in the headers. I didn't want
to have to generate the TOC-like index manually so I used the {Ref Bookmark}
to produce the index for me.
 
S

Stefan Blom

OK, thank you for the clarification.

--
Stefan Blom
Microsoft Word MVP



jerem said:
That's right. I didn't need page numbers in the TOC. What I needed was a
TOC-like index which included listing a Form No. and a Title Description.
What I was working with was a 230 page manual that had Form Numbers, Title
Descriptions, {Page} and {SectionPages} codes in the headers. I didn't
want
to have to generate the TOC-like index manually so I used the {Ref
Bookmark}
to produce the index for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top