Fonsi
05-16-2018, 08:40 AM
Hello guys,
I´m using this code to remove all Sections Breaks from any document.
However, I would like to keep any section break included in tables.
Is there any way to add an exception to the code below so that the macro omit the section breaks in the tables?
Many thanks in advance!
________
Sub RemoveALLSectionBreak()
'
' RemoveALLSectionBreak Macro
'
'
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^b"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub
I´m using this code to remove all Sections Breaks from any document.
However, I would like to keep any section break included in tables.
Is there any way to add an exception to the code below so that the macro omit the section breaks in the tables?
Many thanks in advance!
________
Sub RemoveALLSectionBreak()
'
' RemoveALLSectionBreak Macro
'
'
Selection.WholeStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^b"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchKashida = False
.MatchDiacritics = False
.MatchAlefHamza = False
.MatchControl = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub