PDA

View Full Version : Solved: Removing Section Breaks without removing Footers



murphy84
08-16-2007, 03:11 AM
I've found a common problem with word and wondered if anyone had a workaround in vba for it.

I'm attempting to remove the last section break in a document but without removing the headers/footers associated to that section. Unfortunately performing the following...

Selection.Collapse Direction:=wdLine, Count:=1
Selection.Delete

Removes the headers and footers completely.

I'm going to be stubborn in that I don't think I should have to copy the footer and paste it back in after removing the section break - there must be a simpler way!

Has anyone found a solution to this? Any help is much appreciated.

Thanks

TrippyTom
08-16-2007, 08:57 AM
Hi Murphy,

I'm confused. Headers and Footer are inherently tied to sections. A document without section breaks essentially has one large section. If you remove a section breaks, any Headers or Footers tied to that section will automatically be deleted.

You can't assign different Headers or Footers WITHIN the same section break either... so I'm kind of confused.

mdmackillop
08-16-2007, 02:20 PM
If you're getting rid of the section break, you'll need to accept the header/footer from the previous section. First you have to make the last section H&F Same As Previous, then you can delete the break.

murphy84
08-17-2007, 12:03 AM
Thanks very much for your replies.

mdmackillop I used the same solution as you and it worked perfectly!

fumei
08-21-2007, 11:18 AM
Setting it to SameAs Previous is crucial. If you don't, the H & F from the deleted Section move backwards. The previous Section H & F will change to the H & F contents of the deleted Section.