View Single Post
  #24   Report Post  
Posted to microsoft.public.word.docmanagement
mcarpeneto[_3_] mcarpeneto[_3_] is offline
external usenet poster
 
Posts: 2
Default remove all section breaks quickly?

Thanks, Greg
Your code worked for me.

"Greg Maxey" wrote:

Stefan,

Actually on closer look it doesn't need to be so complicated at all. I can
only guess that using the selection is what makes it uncooperative. This
seems to work just fine for all section breaks (in or not in a table):

Sub ScratchMacro()
Dim oRgn As Range
Set oRgn = ActiveDocument.Range
With oRgn.Find
.Text = Chr(12)
While .Execute
oRgn.Delete
oRgn.Collapse Direction:=wdCollapseEnd
Wend
End With
End Sub




Greg Maxey wrote:
Stephan,

Actually it needs a qualifier to keep from tripping up on a break
found outside a table:

Sub ScratchMacro()
Dim i As Long
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.Text = Chr(12)
While .Execute
oRng.Select
If oRng.Information(wdWithInTable) Then
oRng.MoveEnd wdCharacter, 1
oRng.Collapse wdCollapseStart
With Selection
.MoveRight Unit:=wdCharacter, Count:=1
.SplitTable
.MoveLeft Unit:=wdCharacter, Count:=1
.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend
.Delete Unit:=wdCharacter, Count:=1
.Delete Unit:=wdCharacter, Count:=1
End With
Else
oRng.Delete
oRng.Collapse Direction:=wdCollapseEnd
End If
Wend
End With
End Sub


Stefan Blom wrote:
That seems to be working just fine. Very nice!


On Aug 18, 3:13 am, "Stefan Blom" wrote:
There are no workarounds or fixes available (yet), as far as I know.
:-( --
Stefan Blom
Microsoft Word MVP

"mcarpeneto" wrote in message

...



I too can confirm that in Word 2002 SP3 I cannot use Find and
Replace to deleteSectionBreaks in atable. I can find 'em, but I
can't replace 'em automatically. I just finished manually deleting
85SectionBreaks. I hope Microsoft, or someone, creates a fix or a
workaround for this problem.

BTW, I can automatically replaceSectionBreak(new page) withSection
Break
(continuous). I highlight the document and then go to Page
Setup/Layout/Sectionstart, change New Page to Continuous, and then
click OK.
Unfortunately, DeleteSectionBreakis not an option.

"Stefan Blom" wrote:

I can confirm thatsectionbreaks inserted intotablecells may not be
"seen" by Word when performing a Find & Replace in Print Layout
view. In
Draft view, I can find thebreakbut I cannot delete it by replacing
with nothing. Instead, a manual deletion is required. This
definitely seems like
a bug.

--
Stefan Blom
Microsoft Word MVP

"CDani" wrote in message
...
I also am having trouble deleting the "hidden"sectionbreaks. One
row in a
tableissectionone, the very next row magically becomessection2. I
always
have "display all formatting marks" on, and certainlly know what
a section
breaklooks like. The tables have no visible borders. But the
border betweensection1 row andsection2 row has a slightly darker
and heavier
dotted line. I have found the only way to get rid of the mystery
section
breaks (which do not come up on "find"), is to do a
columnbreakbefore and
after the offending row, delete the row and retype. Not something
I am
enjoying in this 23 page document.

"Travlr1974" wrote:

I can't removesectionbreaks either, it's driving me mad!!! All
the help
I
can find on any forum says to switch to Draft View, select
thesection
break
and delete it. But I can't select thesectionbreak! It's a black
line,
the
mouse becomes a double line with an arrow pointing up and
another pointing
down. It can't be deleted. If I delete the space before it the
paragraphs
merge, tapping enter creates a newsectionbreak!

I can't believe how un-userfriendly Office 2007 is, I was a pro
of 2003
and
I feel stupid when using 2007: everything is hidden, complex and
follows
a
totally absurd logic... Has this version been user-tested for
acceptance
at
all??!

"Stefan Blom" wrote:

Are you sure there aresectionbreaks in the document? What
displays if
you
show nonprinting marks? Note that you may find it easier to
work with
the
breaks in Draft view.

--
Stefan Blom
Microsoft Word MVP

"tinkeysmom" wrote in
message
...
Did you ever figure out how to delete the sections breaks? I
have
a
document
and cannot find them even when I do a search for them with the
^b.
I
have
recently upgraded to 2007 and I can't figure out how to remove
this
section
break! It's driving me crazy!! Kim

"TEAM NORTON" wrote:

I copied an Adobe document into Word and now thesectionbreaks
are
all
over
the place leaving me with very ragged and rambling text. I
can delete the
sectionbreaks one at a time but there are thousands. Can I
delete
them
all
(without deleting the text - done that already!), or align
the text?
Thanks.- Hide quoted text -

- Show quoted text -


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org