5

This should be a common problem for anyone involved in technical writing.

When you insert an image (or table etc.) caption in Word, you get this dialog. You enter your caption, in this case "A happy bicycle" (in yellow).

This might be fine for a happy bicycle, but I want to have captions that have one style for the "enumeration" (label and number) and one style for the description (caption text, as called by Word), as such:

alt text

I have tried searching for this but I haven't found anything yet...

6

When you insert the caption, the entire caption block, both the "header" and the caption's text, are given a single style: Caption. Amending this style will allow you to change all your captions (depending on how you do it, this can be document specific or not), past and present.

To have the header and text appear differently you will need to manually (or maybe there's a macro about to help with this...?) add additional styling to either the header or caption.

What I've done before is to create a new style derived from ("based on") Caption, which has the single effect of adding bold (for example) then, because it is derived, future changes to Caption will cascade to the header as well. It's hardly perfect, and requires manually tweaking each caption as you create them to add the style to the "header", but it has worked for me in the past.

2
  • Ok, but if I create a new style based on Caption, how can I make only the header bold for example and not having that affect the rest of the "block"?
    – Theodor
    Jan 4 '11 at 12:49
  • @Theodor The new style should be "based on" Caption, so anything you don't change in the new style will always match Caption (ie, if you just add bold in your new style, but then later change the font for Caption, or add italic, etc - it will change those settings for the derived style as well). Then you assign the new style to just the header element, leaving the text set still set to the base Caption style.
    – DMA57361
    Jan 4 '11 at 12:58
1

The Caption style is a paragraph style that affects the whole caption. Create a character style to apply the characteristics you want for the label & number (e.g., typeface, size, color, bold, italic). You'll have to manually apply the character style to each caption's label & number, but it's still faster than manually formatting.

1

There is a macro for that here,

but I had to change one line of the code to make it work on MS word 2019:

Sub CaptionBold()
Application.ScreenUpdating = False
Dim RngCap As Range
With ActiveDocument
  On Error Resume Next
  .Styles.Add "CaptionLabel", wdStyleTypeCharacter
  On Error GoTo 0
  .Styles("CaptionLabel").Font.Bold = True
  .Styles("CaptionLabel").Font.BoldBi = True
  .Styles("Caption").Font.Bold = False
  With .Range
    With .Find
      .ClearFormatting
      .Text = ""
      .Style = "Caption"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindStop
      .Format = True
      .Execute
    End With
    Do While .Find.Found
      Set RngCap = .Paragraphs.Last.Range.Duplicate
      With RngCap
        .End = .Start + Len(Split(.Text, " ")(0)) + 1
        .MoveEndUntil " ", wdForward
        .Style = "CaptionLabel"
      End With
      .Collapse wdCollapseEnd
      .Find.Execute
    Loop
  End With
End With
Application.ScreenUpdating = True
End Sub

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.