Here's an old one of mine that could probably be re-written so that it
doesn't use the Selection object:
' Macro created 25/04/1999 by Doug Robbins to apply/re-apply reverse
sequential numbering
'
Numparas = Selection.Paragraphs.Count
Selection.MoveLeft Unit:=wdCharacter, Count:=1
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Selection.Extend
Selection.MoveRight Unit:=wdCharacter, Count:=1
If InStr(Selection.Text, "SEQ") > 0 Then
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Delete Unit:=wdCharacter, Count:=1
Else
Selection.Collapse Direction:=wdCollapseStart
End If
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="=" & Numparas + 1 & "-"
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="SEQ ""ReverseList"""
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(1.27)
.FirstLineIndent = CentimetersToPoints(-1.27)
End With
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.InsertAfter "." & vbTab
Counter = 1
While Counter < Numparas
Selection.Move Unit:=wdParagraph, Count:=1
Selection.Extend
Selection.MoveRight Unit:=wdCharacter, Count:=1
If InStr(Selection.Text, "SEQ") > 0 Then
Selection.MoveRight Unit:=wdCharacter, Count:=2
Selection.Delete Unit:=wdCharacter, Count:=1
Else
Selection.Collapse Direction:=wdCollapseStart
End If
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="=" & Numparas + 1 & "-"
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
Selection.TypeText Text:="SEQ ""ReverseList"""
With Selection.ParagraphFormat
.LeftIndent = CentimetersToPoints(1.27)
.FirstLineIndent = CentimetersToPoints(-1.27)
End With
Selection.MoveRight Unit:=wdCharacter, Count:=4
Selection.InsertAfter "." & vbTab
Counter = Counter + 1
Wend
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
ActiveDocument.Select
ActiveDocument.Fields.Update
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP