Changing TOC2 Style to be 'Capitalize Every Word' in Word 2007

S

suz423

I cannot figure out how to change the 2nd level of my Table of Contents to be
'Capitalize Every Word'. Other options such as 'all caps' can be done in the
change font section but 'capitalize every word' is not there. How can I do
this?
 
D

Doug Robbins - Word MVP

You cannot accomplish this by using the style definition.

What would probably be better would be to format the actual heading 2s in
the document in that way which can be done by using a macro containing the
following code

Dim H2 As Range
Selection.HomeKey wdStory
Selection.Find.Style = wdStyleHeading2
With Selection.Find
Do While .Execute(FindText:="", Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=False) = True
Set H2 = Selection.Range
H2.Case = wdTitleWord
Selection.Collapse wdCollapseEnd
Loop
End With

Then update the table of contents.

The following code will however make the change in just the table of
contents, but if the table of contents is subsequently updated, the Heading
2 entries will revert to their original format:

Dim H2 As Range
Selection.HomeKey wdStory
Selection.Find.Style = wdStyleTOC2
With Selection.Find
Do While .Execute(FindText:="", Forward:=True, _
MatchWildcards:=False, Wrap:=wdFindStop, MatchCase:=False) = True
Set H2 = Selection.Range
H2.Case = wdTitleWord
Selection.Collapse wdCollapseEnd
Loop
End With



--
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, originally posted via msnews.microsoft.com
 

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