FormattedText = Sctn1.Footers(oHdFt.Index).Range.FormattedTextĭo While. OHdFt.LinkToPrevious = Sctn1.Footers(oHdFt.Index).LinkToPrevious DifferentFirstPageHeaderFooter = lDiffFirstHdFt OddAndEvenPagesHeaderFooter = lOddEvenHdFt MsgBox "Selection does not span a Section break", vbExclamation Page orientation, text columns, headers & footers) are addressed.ĭim sPageHght As Single, sPageWdth As Singleĭim sHeaderDist As Single, sFooterDist As Singleĭim sTMargin As Single, sBMargin As Singleĭim sLMargin As Single, sRMargin As Singleĭim sGutter As Single, sGutterPos As Singleĭim lPaperSize As Long, lGutterStyle As Longĭim lMirrorMargins As Long, lVerticalAlignment As Longĭim lOddEvenHdFt As Long, lDiffFirstHdFt As Longĭim bTwoPagesOnOne As Boolean, bBkFldPrnt As Booleanĭim bBkFldPrnShts As Boolean, bBkFldRevPrnt As Booleanĭim bOrientation As Boolean, oHdFt As HeaderFooter The following macro works the other way, across multiple (selected) Section breaks.
You might be able to find a workaround by changing the headers and footers in the section about to be deleted to be 'same as previous' before deleting the section - and if you attached some code which did it to a toolbar button you could make a reasonable interface but it's far from ideal and I can only sympathise.ĭon't know about WP, I'm afraid, so can't answer your final question.As has been discussed, deleting a Section break causes the Section preceding the break to assume the page layout of the following Section. The problem I think you have is that you are trying to delete a section by removing the leading delimiter rather than the trailing delimiter (not that you have a whole lot of choice if you want to delete the last section). There is an analagous situation with paragraphs but the behaviour when you delete a paragraph delimiter differs according to whether there is text in the paragaraph or not. This works well if you delete a complete section (or the section break following an empty section) but not very well when there is text in both sections. Section attributes are held along with the trailing section delimiter - delete that and attributes from what becomes the new trailing delimiter take effect. I do agree it is not entirely intuitive, but as far as I know you are stuck with it. This is what I expected and, although not what you describe, is I suspect what you get. The section 2 header and footer were deleted along with the section 2 delimiter. I got section 1 with section 1 headers (as before), section 2 with section 3 (as was) headers, section 3 with section 4 (as was) headers, etc. I followed your instructions to the letter and when I deleted the second section break (at the end of the second section).
If we don't need some of the boiler plate sections and delete one of those sections, the deleted section's headers get moved to the previsous section, which is wrong.Īm I just stuck with extra blank pages in my quotation? And manual page numbering?ĭoes WordPerfect work the same way? RE: Deleting a section break in Word messes up previous section TonyJollans (Programmer) 30 Dec 03 12:02 In reality, our quotation template has 5 sections, each with different headers and footers. If someone needs a short quote letter and deletes the second page, the first page will have the wrong header and footer. Since you can only change headers between sections (right?), the template has two sections. Imagine if you will, a quotation document with the need for different headers on page 1 and page 2.
Deleting a section should not affect the previous one's header and footer (I think). Now, delete, for instance, the second section break and see that your first section header and footer now say "Test 2" instead of "Test 1". See how your document has multiple headers and footers.
Repeat as often as you like, making sections with different headers and footers. Now, change the header and footer in the second section to something like "Test 2". Now, put in some random text and at then a section break (next page type). Put something like "Test 1" in the header and footer of page 1 (the only page that exists).