Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    England
    Posts
    569
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.
    Attached Images Attached Images

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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.

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

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

    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.Fi elds.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

  4. #4
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    England
    Posts
    569
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    Appreciate it chaps,

    m.q.

Posting Permissions

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