#1
|
|||
|
|||
Deleting continuous section breaks
From long experience, I avoid continuous section breaks (CSB) like the plague, but occasionally I have to deal with them in business proposals, when a writer has inserted thmn for what should be a borderless table. I had this experience yesterday, with the following difficulty.
Two documents, each from our template, which has a next-page section break (NPSB) after the title page and another after the front matter, before normal page numbering begins. One doc had two CSBs on one page; the other, as far as I could tell (even checking the full document in draft view), a surprising three. In both cases, I was unable to delete the CSBs without having the NPSB preceding them changed into a CSB. (In one case, removal also eded up converting every text paragraph to a comma followed by a space, but the document may have had some unrelated corruption.) I tried separating the CSBs from the NPSB above with extra paragraphs, an addtional NPSB, and so forth, but the conversion happened each time. In both cases, my only solution was to delete all section breaks and transfer everything after front matter (minus a final emplty paragraph), into a fresh document based on the same template with its title page and front matter properly segregated. My questions are why the conversion of the NPSB occurs, and whether there is a method of deleting the CSBs without encountering this difficulty. Thank you. |
#2
|
||||
|
||||
You could insert next page section breaks both sides of the continuous one, then select all three breaks and delete them together. The following macro automates the process:
Code:
Sub DelContBrk() Dim Rng As Range With Selection.Sections.First Set Rng = .Range.Characters.Last With Rng .InsertBreak Type:=wdSectionBreakNextPage .Start = .Start - 1 .End = .End + 1 .Characters.Last.Next.InsertBreak Type:=wdSectionBreakNextPage .End = .End + 1 .Text = vbNullString End With End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Breaks
Thank you, Paul; much obliged.
|
#4
|
|||
|
|||
Almost...
Paul, I think I need a bit of further clarification.In the attached text document, which replicates the situation I had -- multi-coluns between 2 CSBs and an odd CSB further on. I have tried running your macro various ways, with different results. I see that it says, Selection, which I take to me that I must select a part of the document at least including the three CSBs. I assume that including more in the selection is not a problem. When I run the macro in this manner, it converts the document above the section also to 2 columns.
If I select only the text between the first two section breaks, it works, leaving a single NPSB above, but this leaves the remaining CSB in place. I know you are a master at macros. Is there something I have misunderstood from your indication? Thanks. |
#5
|
||||
|
||||
The macro deletes whatever Section break terminates the current selection's first Section; it doesn't process multiple Sections.
There is no attachment to your post.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
Thanks again.
Thank you for the clarification. If I select the 2-column text and the second CSB, the macro then removes both CSBs, returning the 2-column text to one and leaving the NPSB above. Selecting the remaining, odd CSB further down and running the macro deletes it without altering the NPSB.
Very useful! |
Tags |
section breaks continuous |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2007, cannot insert Section Break (Continuous), only Section Break (Next Page) | btse1 | Word | 3 | 11-01-2018 09:23 AM |
Word 2013 - When deleting section breaks, cursor jumps to beginning of document | ranholmom66 | Word | 3 | 07-01-2016 06:01 AM |
Hidden page breaks and section breaks | jrasicmark | Word | 3 | 06-02-2014 11:28 PM |
Section - Page Break changes to Section - continuous? | donaldadams1951 | Word VBA | 13 | 03-27-2014 07:03 PM |
Deleted Section Breaks Changes Page Breaks | Brantnshellie | Word | 0 | 02-01-2009 09:22 PM |