Andreas Hermle
asked on
Changing type of section breaks in Word using VBA
I would like to change next-page section breaks into odd-page section breaks in Word using VBA. How come this code below does not work? I guess Word gets upset since the page numbering has to be rebuild completely, then?
Sub ChangeSecBrk()
Dim sec As Section
For Each sec In ActiveDocument.Sections
If sec.PageSetup.SectionStart = wdSectionNextPage Then
sec.PageSetup.SectionStart = wdSectionOddPage
End If
Next sec
End Sub
Strangely enough, I tried to change "odd-page" section breaks into "next-page" section breaks using above VBA syntax (and adjusting the code) and the odd-page section breaks turned into continuous ones.
Sub ChangeSecBrk()
Dim sec As Section
For Each sec In ActiveDocument.Sections
If sec.PageSetup.SectionStart
sec.PageSetup.SectionStart
End If
Next sec
End Sub
Strangely enough, I tried to change "odd-page" section breaks into "next-page" section breaks using above VBA syntax (and adjusting the code) and the odd-page section breaks turned into continuous ones.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.