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 / Numbering / August 2004

Tip: Looking for answers? Try searching our database.

Need Macro for paragraph numbering, inside para, with a defined start point.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy - 14 Aug 2004 06:36 GMT
I've got both parts, but can't get them into one macro.

1st: This macro inserts an AutoNumLgl field at exactly where my
insertion point is, then consecutively numbers each paragrph when I
run the macro.
(I assigned it to Alt N.)

Sub AutoNumAltN()
'
   Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
Text:= _
       "AUTONUMLGL \e ", PreserveFormatting:=False
End Sub

2nd: This macro numbers the beginning of a Header at the Start Point I
define, i.e. 29. (I assigned it to Alt 6.)

Sub AutoNumAt_Alt6()
'
       Dim bText
   bText = InputBox("Start At:")
   With ListGalleries(wdNumberGallery).ListTemplates(1).ListLevels(1)
       .NumberFormat = "%1"
       .TrailingCharacter = wdTrailingTab
       .NumberStyle = wdListNumberStyleArabic
       .NumberPosition = InchesToPoints(0.25)
       .Alignment = wdListLevelAlignLeft
       .TextPosition = InchesToPoints(0.5)
       .TabPosition = InchesToPoints(0.5)
       .ResetOnHigher = 0
       .StartAt = bText
       .LinkedStyle = ""
   End With
   ListGalleries(wdNumberGallery).ListTemplates(1).Name = ""
   Selection.Range.ListFormat.ApplyListTemplate
ListTemplate:=ListGalleries( _
       wdNumberGallery).ListTemplates(1),
ContinuePreviousList:=False, ApplyTo:= _
       wdListApplyToWholeList,
DefaultListBehavior:=wdWord10ListBehavior
End Sub

Now - could anyone out there give me the macro that will allow me to
number consecutive paragraphs, from within the paragraph (not in front
of the header) at the start # I define? A combination of these two.
Please?
Chad DeMeyer - 17 Aug 2004 19:00 GMT
Andy,

The AUTNUMLGL field does not support restarts or jumps in numbering.  The
LISTNUM field can be used with an "\s" switch which allows you to specify
the starting number, but when I played with this I could not figure out how
to get the LISTNUM field to include the full context of heading numbers.  It
would always precede the lowest level with ones (e.g., 1.x, 1.1.x, 1.1.1.x)
even when following a heading number such as, e.g., 2.3.4 (I get 1.1.1.x).
So unless somebody else knows some fancy trick to make it work, I don't
think a macro is going to be able to do what you want.  A SEQ field preceded
by a STYLEREF field (just like figure and table captions) would almost work,
except that the STYLEREF field would be hardcoded to a particular heading
style, so if you inserted a different level heading above the paragraph,
your STYLEREF field wouldn't automatically update to reflect that heading as
being the closest context for the LISTNUM field that follows.

Sorry I couldn't be of more help,
Regards,
Chad

> I've got both parts, but can't get them into one macro.
>
[quoted text clipped - 42 lines]
> of the header) at the start # I define? A combination of these two.
> Please?
 
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.