Re: how can I delete an entire section

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



This is not nearly as straightforward as you might think. The difficulty is
that the section-level formatting (margins, headers/footers, columns, paper
sources, etc.) is stored in the section mark at the _end_ of the section.
The article http://www.word.mvps.org/FAQs/Formatting/WorkWithSections.htm
explains some of the hiccups you can run into by deleting a section break.

In code, you can run the command

wordDoc.Sections(N).Range.Delete

but the effects will be different depending on whether the Nth section is
the last one in the document. You may also need to adjust the formatting and
the content of the headers in the following section(s).

It might be more effective to set the entire section to the Hidden font
format rather than deleting it.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Keith G Hicks wrote:
I should make it clear that I want to delete the whole section -
content, headers, footers, etc. - not just the section break.

Keith

"Keith G Hicks" <krh@xxxxxxxxxxx> wrote in message
news:eu9oe95#HHA.5164@xxxxxxxxxxxxxxxxxxxxxxx
word 03
access 2k

I need to programatically delete an entire section from a document
in the event that section does not apply to a customer. How would I
do this in vba?

Thanks,

Keith


.



Relevant Pages

  • Re: Headers and footers wont print
    ... at least some portions also suggests that Hidden formatting isn't the entire ... Headers and footers seem to be ... I have copy-pasted the rogue sections to fresh blank documents. ...
    (microsoft.public.mac.office.word)
  • Re: Formatting Data in excel VBA
    ... an excel spreadsheet but the data is never formatted in a way that I can use. ... I use a program call BRDATA to handle all of the stores inventory control. ... What I want to be able to do and have done up until the acutall formatting ... headers that I use when working with BRDATA ...
    (microsoft.public.excel.programming)
  • Re: Deleting Section Breaks and loosing headers!
    ... A section break stores the formatting of the *previous* section (and the ... formatting when deleting section breaks, including headers and footers, see ... Note that if headers and footers are the only items that you want to ...
    (microsoft.public.word.pagelayout)
  • Re: find and replace
    ... is still note finding words in my footnotes. ... then specify the text or formatting in the Find what box. ... Specify the formatting correctly. ... through only the main document (not headers (header and footer: ...
    (microsoft.public.word.docmanagement)
  • Re: Page number difficulties
    ... simply insert an Odd Page section break before each of them. ... Once you have the desired section formatting, ... You can have up to three different headers (and three ... Removing the page numbers does not help, ...
    (microsoft.public.word.docmanagement)