Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Long Documents / November 2003

Tip: Looking for answers? Try searching our database.

Restart Numbering with VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Scott A - 13 Nov 2003 10:45 GMT
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
Margaret Aldis - 13 Nov 2003 11:58 GMT
Hi again Scott

Thre's more than one way to skin a cat. See

http://www.syntagma.demon.co.uk/FAQs/ListRestartMethods.htm

Signature

Margaret Aldis - Microsoft Word MVP
Syntagma partnership site: http://www.syntagma.co.uk
Word MVP FAQ site: http://www.mvps.org/word

> I'm interested in setting up a macro that will run the
> Restart Numbering command (from the Format, Bullets and
[quoted text clipped - 64 lines]
>
> Scott
Scott A - 13 Nov 2003 15:56 GMT
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
>-----Original Message-----
>Hi again Scott
[quoted text clipped - 14 lines]
>>
>> Here's the code:

==========================================================
>> Sub RenumberList()
>> '
[quoted text clipped - 44 lines]
>> DefaultListBehavior:=wdWord9ListBehavior
>> End Sub

==========================================================

>> I would love to hear your ideas!
>>
[quoted text clipped - 3 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.