Is anyone else as frustrated as I am with Word's so-called Title Case (called "Capitalize Each Word" in Word 2007)?  I haven't actually found any use for that option; in general, only the more important words of a title should begin with uppercase letters.

But ta-da!  The Internet comes to the rescue, again.  Allen Wyatt's WordTips has a macro that will do what is needed.  Here it is, modified slightly—I added "an" and "and" to the list of words that should not be capitalized, and removed "is"; I was taught that all verbs, even small ones, are important enough to be capitalized.  It's easy to change the list to suit your needs, and I may modify it further through time.  If the excluded words occur at the beginning of the title, they are left in uppercase.

Sub TitleCase()
    Dim lclist As String
    Dim wrd As Integer
    Dim sTest As String

    ' list of lowercase words, surrounded by spaces
    lclist = " a an as and at but by for from in into nor of or the this to with "

    Selection.Range.Case = wdTitleWord

    For wrd = 2 To Selection.Range.Words.Count
        sTest = Trim(Selection.Range.Words(wrd))
        sTest = " " & LCase(sTest) & " "
        If InStr(lclist, sTest) Then
            Selection.Range.Words(wrd).Case = wdLowerCase
        End If
    Next wrd
End Sub

I'm no Word macro expert, but found this easy to install in Word 2007.   On the View tab, click the arrow under Macros.  Choose View Macros, then change the macro name to "TitleCase" (without the quotes) and click Create.  Visual Basic opens up with your macros, including one at the end for TitleCase.  Replace the rather empty text there—from "Sub Titlecase ()" through "End Sub"—with the macro above.  I added a button for the TitleCase macro to my Quick Access Toolbar, and now it's ready whenever I want it.

posted by sursumcorda on Monday, April 13, 2009 at 08:17 PM
Permalink
Category Computing
Comments