-
Solved: Delete Section Breaks
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:
[VBA] 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
[/VBA]
Help!!
-
Hi Anne
I don't really understand why replace isn't working there... so maybe you could just loop the find and delete it, if you see what I mean - that does seem to work fine [VBA]Sub Macro4()
With ActiveDocument.Content.Find
.ClearFormatting
.Text = "^b"
.Forward = True
Do While .Execute = True
.Parent.Delete
Loop
End With
End Sub[/VBA]
K :-)
-
Seems to work! Thanks a bunch!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules