PDA

View Full Version : Solved: Delete Section Breaks



Anne Troy
04-03-2005, 12:31 PM
In the attached sample document, I am unable to do something I am normally able to do: Find and replace section breaks with nothing. I want to get rid of the section breaks.

This is the recorded code that would normally work:
Sub Macro4()
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^b"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub


Help!!

Killian
04-03-2005, 05:58 PM
Hi Anne :hi:
I don't really understand why replace isn't working there... :dunno so maybe you could just loop the find and delete it, if you see what I mean - that does seem to work fine Sub Macro4()
With ActiveDocument.Content.Find
.ClearFormatting
.Text = "^b"
.Forward = True
Do While .Execute = True
.Parent.Delete
Loop
End With
End Sub

Anne Troy
04-03-2005, 06:05 PM
Seems to work! Thanks a bunch!!