That is not hard. However, it turns out that someone creating the document managed to mark one or more section breaks as hidden text. When the section breask are removed, is messes up layout!
I had no idea that one even could make a functioning section break hidden. I have no idea why anyone would want to do this! However, you can, and someone did.
Thoughts on code to unhide section breask and only section breaks? (This is relaxation for me. No pressure. I expect that Doug Robbins will work it out on the Answers forum.)
Here is the original question thread on the Answers forum in case you want to just chime in there.
https://answers.microsoft.com/en-us/sub ... e925b02919
The following code will unhide a section break. I need to loop it until there is no hidden section break.
Code: Select all
Sub FixSectionNotHidden()
'
' FixSectionNotHidden Macro
'
'
With Selection.Find
.ClearFormatting
.Font.Hidden = True
.Text = "^b"
.Forward = True
.Wrap = wdFindContinue
.Execute
End With
With Selection.Font
.Hidden = False
End With
End Sub
The next steps are to use range object rather than selection object and loop until not found.