Changing the NumberFormat automatically on ListGallery when the title changes

Viewed 26

I have a word archive with a long list of appendixes and sometimes I have to add a new one between old ones, and I was wondering if it would be possible that, when I add a new appendix, the number format on the number gallery changes automatically according to it's new letter.

Example: At first I have this:

Title: Appendix "C"

Numberformat on numbergallery:

"C1." "C2." "C3." ...

Then I add a new appendix above appendix C, so now the previously called appendix "C" turns into Appendix "D".

So, what I want is that the Number format on the number gallery adjusts accordingly as below:

New title: Appendix "D"

Numberformat on numbergallery: "D1." "D2." "D3." ...

Is it possible?

I've been trying to change the code to do that, but the numberformat command doesn't seem to accept programing.

The code I'm trying to edit is the one bellow, but it won't work:

Dim apend_letra As String

apend_letter = X


    With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1)
        **.NumberFormat = "apend_letter %1."**
        .TrailingCharacter = wdTrailingTab
        .NumberStyle = wdListNumberStyleArabic
        .NumberPosition = CentimetersToPoints(0.63)
        .Alignment = wdListLevelAlignLeft
        .TextPosition = CentimetersToPoints(1.27)
        .TabPosition = wdUndefined
        .ResetOnHigher = 0
        .StartAt = 1

Thank you very much in advance.

0 Answers
Related