Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2008

Tip: Looking for answers? Try searching our database.

Table of Contents Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jerem - 15 Feb 2008 01:53 GMT
I'm trying to generate a TOC with 2 levels (from Heading Styles), however I
don't want page numbers appearing for level 1.  Right now the Code looks like
this { TOC \o "1-2" \h\z\u } and it is generating two levels with page
numbers for each level.  I tried to look this up in Word's Help area and it
says to use \n if you don't want page numbers, however, when using this it
takes out page numbers entirely.  I want page numbers for level 2 but not for
level 1.  Can anyone tell me how to specify that?  Also, I've tried to find a
list on websites and in the Word help feature that delineates switches that
are TOC specific and that gives examples of what the switch does and examples
of the exact use of them - haven't had much luck there.  Any tips pointing me
in the right direction would be appreciated.  Thanks in advance.
Doug Robbins - Word MVP - 15 Feb 2008 02:23 GMT
Modify the TOC 1 Style so that the tab stop for the page number is off the
page and so that it does not have a leader.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> I'm trying to generate a TOC with 2 levels (from Heading Styles), however
> I
[quoted text clipped - 15 lines]
> me
> in the right direction would be appreciated.  Thanks in advance.
Stefan Blom - 15 Feb 2008 10:08 GMT
Or add \n "1-1" to the TOC field code to suppress the page numbers for level
1.

Signature

Stefan Blom
Microsoft Word MVP

> Modify the TOC 1 Style so that the tab stop for the page number is off the
> page and so that it does not have a leader.
[quoted text clipped - 19 lines]
>> pointing me
>> in the right direction would be appreciated.  Thanks in advance.
jerem - 15 Feb 2008 22:53 GMT
Works like a charm.  Thanks.

> Or add \n "1-1" to the TOC field code to suppress the page numbers for level
> 1.
[quoted text clipped - 22 lines]
> >> pointing me
> >> in the right direction would be appreciated.  Thanks in advance.
Stefan Blom - 18 Feb 2008 09:22 GMT
You are welcome.

Signature

Stefan Blom
Microsoft Word MVP

> Works like a charm.  Thanks.
>
[quoted text clipped - 31 lines]
>> >> pointing me
>> >> in the right direction would be appreciated.  Thanks in advance.
jerem - 15 Feb 2008 22:45 GMT
Hi Doug,
This is certainly a novel idea.  Did not expect this response, was expecting
a switch to turn off level 1 page numbering.  I'm going to try Stefan Blom's
suggestion, however, this little trick is worthy of jotting down for future
reference.   Thanks.

> Modify the TOC 1 Style so that the tab stop for the page number is off the
> page and so that it does not have a leader.
[quoted text clipped - 18 lines]
> > me
> > in the right direction would be appreciated.  Thanks in advance.
Jean-Guy Marcil - 18 Feb 2008 14:39 GMT
> Hi Doug,
> This is certainly a novel idea.  Did not expect this response, was expecting
> a switch to turn off level 1 page numbering.  I'm going to try Stefan Blom's
> suggestion, however, this little trick is worthy of jotting down for future
> reference.   Thanks.

You would need Doug's "trick" if you had a complex TOC that would require
that you hide the page numbers for levels 1, 2 and 4 in a 5-level TOC. In
such cases, you can use the \n switch for levels 1 and 2, but not for 4
because only one \n switch is allowed and it must be for consecutive levels.
So, you would set your TOC with the \n switch for levels 1 and 2, and use
Doug's idea for level 4.
Stefan Blom - 19 Feb 2008 11:16 GMT
Good point, but note that you can re-assign TOC levels and then still make
use of the \n switch; see http://sbarnhill.mvps.org/WordFAQs/TOCTips.htm.

Signature

Stefan Blom
Microsoft Word MVP

>> Hi Doug,
>> This is certainly a novel idea.  Did not expect this response, was
[quoted text clipped - 12 lines]
> So, you would set your TOC with the \n switch for levels 1 and 2, and use
> Doug's idea for level 4.
Jean-Guy Marcil - 19 Feb 2008 14:08 GMT
> Good point, but note that you can re-assign TOC levels and then still make
> use of the \n switch; see http://sbarnhill.mvps.org/WordFAQs/TOCTips.htm.

Another good trick to add to the bag!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.