Restart Numbering with VBA

S

Scott A

I'm interested in setting up a macro that will run the
Restart Numbering command (from the Format, Bullets and
Numbering menu)

The macro I recorded seems to do a lot of stuff I don't
want, and doesn't do some things I want it to, like
restart numbering for multiple styles (I only have two in
the template, a LN1 and LN2, format "123" and "abc,
respectively)...

Here's the code:

==========================================================
Sub RenumberList()
'
' RenumberList Macro
' Macro recorded 12.11.2003 by scott.adams
'
Selection.Range.ListFormat.RemoveNumbers
NumberType:=wdNumberParagraph
With ListGalleries(wdNumberGallery).ListTemplates
(7).ListLevels(1)
.NumberFormat = "%1."
.TrailingCharacter = wdTrailingTab
.NumberStyle = wdListNumberStyleArabic
.NumberPosition = CentimetersToPoints(0)
.Alignment = wdListLevelAlignLeft
.TextPosition = CentimetersToPoints(0.7)
.TabPosition = CentimetersToPoints(0.7)
.ResetOnHigher = 0
.StartAt = 1
With .Font
.Bold = wdUndefined
.Italic = wdUndefined
.StrikeThrough = wdUndefined
.Subscript = wdUndefined
.Superscript = wdUndefined
.Shadow = wdUndefined
.Outline = wdUndefined
.Emboss = wdUndefined
.Engrave = wdUndefined
.AllCaps = wdUndefined
.Hidden = wdUndefined
.Underline = wdUndefined
.Color = wdUndefined
.Size = wdUndefined
.Animation = wdUndefined
.DoubleStrikeThrough = wdUndefined
.Name = ""
End With
.LinkedStyle = "List Number"
End With
ListGalleries(wdNumberGallery).ListTemplates(7).Name
= ""
Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
wdNumberGallery).ListTemplates(7),
ContinuePreviousList:=False, ApplyTo:= _
wdListApplyToWholeList,
DefaultListBehavior:=wdWord9ListBehavior
End Sub
==========================================================


I would love to hear your ideas!

Thanks,

Scott
 
S

Scott A

I've used VBA for lots of things, but I haven't come
across DoCmd.SkinCat...

Thanks for the article, it is very informative. I've
experienced a range of behaviors with list numbers - this
helped me identify the source for many of these 'features'.

Thanks!

Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top