Seq field solution?
Geoff Lane
geoff at gjctech.co.uk
Thu Mar 6 00:23:34 MST 2008
On Thursday, March 6, 2008, jopakent at comcast.net wrote;
> Can someone point me in the right direction before I self-emmolate out of utter frustration?
---
You can create macros (record them if you're not comfortable with the
VBA Editor) to create the required levels. For each level, define a
sequence and also include code to reset the next level down to zero.
While you can reset all lower levels, you should only need to reset
the next level down unless you are in the habit of following (say) a
level 1 item with a level 3 item. You can add these macros to a custom
tool bar or menu.
It's probably easier to show you. Here's some I prepared earlier:
Sub InitialiseOutline()
' Set level 1 initially to zero
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L1 \h \r0", _
PreserveFormatting:=False
End Sub
Sub Level1()
' Add a level 1 number and reset level 2 to zero
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L1", _
PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L2 \h \r0", _
PreserveFormatting:=False
End Sub
Sub Level2()
' Copy current level 1, add a level 2 number
' and reset level 3 to zero
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L1 \c", _
PreserveFormatting:=False
Selection.TypeText "."
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L2", _
PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L3 \h \r0", _
PreserveFormatting:=False
End Sub
Sub Level3()
' Copy current levels 1 and 2 and
' add a level 3 number
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L1 \c", _
PreserveFormatting:=False
Selection.TypeText "."
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L2 \c", _
PreserveFormatting:=False
Selection.TypeText "."
Selection.Fields.Add Range:=Selection.Range, _
Type:=wdFieldEmpty, Text:="SEQ L3", _
PreserveFormatting:=False
End Sub
Note that if you insert a list item the following list items won't
change to reflect the insertion until you update the associated
fields. To do that, select the list (or the entire document) then
press F9.
HTH,
--
Geoff
More information about the TECHWR-L
mailing list