• WordXP: Is it poss. to modify Caption Style in tem (XP SP-2)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » WordXP: Is it poss. to modify Caption Style in tem (XP SP-2)

    Author
    Topic
    #394053

    Hi,

    I want my caption to take the Heading 1 Number, increment & also have a colon and space after it.

    E.g. “Figure 2-13: ”

    i.e. it’s under Heading # 2 (the level 1 heading), the 13th Figure, then has a colon and space after.

    How can I do that?

    TIA,

    m.q.

    Viewing 3 reply threads
    Author
    Replies
    • #719437

      You could also do it one other way. You would first have to have chapter numbering, which I assume that you have for the first heading level. In the Insert/Caption dialog box, you then press the “Numbering” button & check the box to include chapter numbering. After you insert one caption, manually place the colon-space where you want. Select the whole caption & make it an autotext entry…assign a shortcut key to it. The only problem with this method is that you have to manually put in all the captions.

      At least in Word 2000, I couldn’t figure a way to change the AutoCaption settings.

    • #719438

      You could also do it one other way. You would first have to have chapter numbering, which I assume that you have for the first heading level. In the Insert/Caption dialog box, you then press the “Numbering” button & check the box to include chapter numbering. After you insert one caption, manually place the colon-space where you want. Select the whole caption & make it an autotext entry…assign a shortcut key to it. The only problem with this method is that you have to manually put in all the captions.

      At least in Word 2000, I couldn’t figure a way to change the AutoCaption settings.

    • #719327

      I once did something similar by writing an InsertCaption macro that placed the appropriate value in the dialog box before displaying it.

      StuartR

      Edited to add…
      I found this example lying around, it deletes any spaces or tabs the user put after the caption number and replaces them with SPACE HYPHEN SPACE

      Public Sub InsertCaption()
      Dim lngStatus As Long
      Dim rngCaption As Range
      Dim i As Integer

      ‘ Display the built in Word Insert Caption dialog box
      lngStatus = Dialogs(wdDialogInsertCaption).Display

      ‘ status of 1 means the OK button was selected
      If lngStatus = -1 Then
      Set rngCaption = Selection.Paragraphs(1).Range
      ‘ Move to the end of the last field, allows for Figure 1 or Table 2-4 etc.
      rngCaption.Start = Selection.Paragraphs(1).Range.Fields(rngCaption.Fields.Count).Result.End
      ‘ Move past the field to the text
      rngCaption.Start = rngCaption.Start + 1
      ‘ Select the next character
      rngCaption.End = rngCaption.Start + 1
      ‘ Erase any spaces or tabs before the user inserted text
      For i = 1 To 10
      Select Case rngCaption.Text
      Case ” “, vbTab, “-”
      rngCaption.Delete
      rngCaption.End = rngCaption.End + 1
      Case Else
      Exit For
      End Select
      Next i
      rngCaption.Collapse direction:=wdCollapseStart
      rngCaption.Text = ” – ”
      End If
      End Sub

    • #719328

      I once did something similar by writing an InsertCaption macro that placed the appropriate value in the dialog box before displaying it.

      StuartR

      Edited to add…
      I found this example lying around, it deletes any spaces or tabs the user put after the caption number and replaces them with SPACE HYPHEN SPACE

      Public Sub InsertCaption()
      Dim lngStatus As Long
      Dim rngCaption As Range
      Dim i As Integer

      ‘ Display the built in Word Insert Caption dialog box
      lngStatus = Dialogs(wdDialogInsertCaption).Display

      ‘ status of 1 means the OK button was selected
      If lngStatus = -1 Then
      Set rngCaption = Selection.Paragraphs(1).Range
      ‘ Move to the end of the last field, allows for Figure 1 or Table 2-4 etc.
      rngCaption.Start = Selection.Paragraphs(1).Range.Fields(rngCaption.Fields.Count).Result.End
      ‘ Move past the field to the text
      rngCaption.Start = rngCaption.Start + 1
      ‘ Select the next character
      rngCaption.End = rngCaption.Start + 1
      ‘ Erase any spaces or tabs before the user inserted text
      For i = 1 To 10
      Select Case rngCaption.Text
      Case ” “, vbTab, “-”
      rngCaption.Delete
      rngCaption.End = rngCaption.End + 1
      Case Else
      Exit For
      End Select
      Next i
      rngCaption.Collapse direction:=wdCollapseStart
      rngCaption.Text = ” – ”
      End If
      End Sub

    Viewing 3 reply threads
    Reply To: WordXP: Is it poss. to modify Caption Style in tem (XP SP-2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: