saphire99
12-25-2015, 05:59 AM
Hello,
to all - hope everyone is having a great day today! :hi:
I have a numbering problem that I have been trying to work out for a while.
I want to Insert sequential numbers in front of my heading 1
For example
1. Science
2. Maths
3. History
I have inserted an autonum field - but it is not working when I run it on other heading 1.
Sub InsertNumber()
'Insert Sequential Numbers at the beginning of Heading 1
With ActiveDocument.Styles("Heading 1").Font
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
End Sub
I am a bit lost.
I wouldn't imagine it to be this troublesome to insert some numbers before the headings but alas it is.
I have also researched online but nothing has come up.
Please advise - I really appreciate the help
thank you so much :grinhalo:
Saphire
to all - hope everyone is having a great day today! :hi:
I have a numbering problem that I have been trying to work out for a while.
I want to Insert sequential numbers in front of my heading 1
For example
1. Science
2. Maths
3. History
I have inserted an autonum field - but it is not working when I run it on other heading 1.
Sub InsertNumber()
'Insert Sequential Numbers at the beginning of Heading 1
With ActiveDocument.Styles("Heading 1").Font
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, Text:= _
"AUTONUM \* Arabic ", PreserveFormatting:=False
End Sub
I am a bit lost.
I wouldn't imagine it to be this troublesome to insert some numbers before the headings but alas it is.
I have also researched online but nothing has come up.
Please advise - I really appreciate the help
thank you so much :grinhalo:
Saphire