A
avkokin
Hello. There is one document that include some sections. I need to
move into the start of every sections (except the first section) and
insert some field thereto. I need to make the round all existing
sections except first section. How I can do it?
There is my example of code but it is wrong and the Word close with
error:
Sub insField()
Dim sec As Section
If Not ActiveDocument.Sections(1) Then
For Each sec In ActiveDocument.Sections
Selection.MoveStart unit:=wdSection
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
Selection.TypeText Text:="page"
Next sec
End If
End Sub
Thank you.
move into the start of every sections (except the first section) and
insert some field thereto. I need to make the round all existing
sections except first section. How I can do it?
There is my example of code but it is wrong and the Word close with
error:
Sub insField()
Dim sec As Section
If Not ActiveDocument.Sections(1) Then
For Each sec In ActiveDocument.Sections
Selection.MoveStart unit:=wdSection
Selection.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty,
preserveformatting:=False
Selection.TypeText Text:="page"
Next sec
End If
End Sub
Thank you.