Results 1 to 10 of 10
  1. #1
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    134
    Thanks
    1
    Thanked 0 Times in 0 Posts

    TOC Capitalization Issues (2003 SP3)

    I just created a template for a report, and when I generate the TOC, the capitalization is wrong. For example, second level headings should be title case (first letter capitalized on all words). Instead, it's generating as all lower case. Is there a way to format so that it will generate correctly? I can't see any way to tell it how to capitalize, except as all caps.

    Thanks for your help.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    The TOC copies the text literally from the items that contribute to the TOC, including capitalization (i.e. text formatted with heading styles or TC entries, depending on how the TOC was made). So the best solution is to format those items correctly.

    Otherwise, you can select the TOC, then select Format | Change Case... and apply the format you want. Keep in mind that if you refresh the entire TOC, this formatting will be overruled again, so you should apply it when the document has been finalized.

  3. #3
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    134
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    Hans,

    The second level style that the TOC is pulling from is formatted as ALL CAPS in the document, which is how is needs to be. However, the TOC is not generating as all caps, so maybe your statement that it pulls exactly from the heading style isn't entirely correct?

    The generated TOC comes out something like this:

    3.0 SITE PLAN
    3.1 Site Description
    3.2 overview of previous investigation
    3.3 Data gaps
    3.4 Data quality objectives
    3.5 schedule

    The first level headings are correct as all caps, so I don't want to select the entire TOC and change the case. What I was hoping was that I could somehow add the change case formatting to the second level headings in the TOC set up dialog box so I don't have to change them one at a time every time I update the TOC with new headings. I guess there's no way to do that?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    You're correct, I see that All Caps and Small Caps aren't transferred to the TOC. I never use (and would never use) such formatting, so I hadn't noticed that.

    > I guess there's no way to do that?

    Not as far as I know, sorry - All Caps and Small Caps are possible font formatting properties and hence possible style properties but Title Case isn't.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    134
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    I figured it out! Since I had the style set to all caps, I wasn't careful how I actually typed the text. If I type the text as title case, it will end up being all caps in the document and title case in the TOC.

    Thanks for your help! I never would have thought of that in a million years.

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    <P ID="edit" class=small>(Edited by jscher2000 on 11-Aug-08 13:21. Sample macro added)</P>Perhaps it would be easier to transform the text in the document rather than trying to copy over the character formatting? This might be possible using Find and Replace, but probably a macro will be required.

    <code>Sub ConvertACFormattingToTC()
    If MsgBox("Convert headings styled with ALL CAPS to Title Case text?", _
    vbYesNo + vbQuestion) = vbNo Then Exit Sub
    ' Limit changes to the following paragraph styles:
    Const strStyleList = "Heading 1|Heading 2|Heading 3"
    With Selection
    .HomeKey wdStory
    ' Find instances of "All Caps" formatting
    With .Find
    .ClearFormatting
    .Text = ""
    .Font.AllCaps = True
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindStop
    .Format = True
    .MatchCase = False
    .MatchWholeWord = False
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
    End With
    ' For each found range, transform the text to Title Case
    ' (Each Word) and restore AllCaps formatting
    Do While .Find.Execute = True
    If InStr(1, strStyleList, .Style, vbTextCompare) Then
    .Range.Case = wdTitleWord
    .Font.AllCaps = True
    .Collapse wdCollapseEnd
    End If
    Loop
    ' Clean up before next find
    With .Find
    .Format = False
    .ClearFormatting
    End With
    End With
    End Sub</code>

  7. #7
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    Hi Caniac,

    The simple solution is to format the corresponding TOC Style as all caps ...
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  8. #8
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: TOC Capitalization Issues (2003 SP3)

    Hi Caniac
    Please post the field code for your TOC.
    Regards
    Don

  9. #9
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    134
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    jscher2000,
    Thank you for the macro! I haven't been able to try it yet, but I'm hoping to get a chance to get back to this template later today.

  10. #10
    2 Star Lounger
    Join Date
    Nov 2002
    Posts
    134
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: TOC Capitalization Issues (2003 SP3)

    Hi W.D.
    The field code for the TOC is { TOC o "1-3" h z u }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •