PC Review


Reply
Thread Tools Rate Thread

how can I delete an entire section

 
 
Keith G Hicks
Guest
Posts: n/a
 
      20th Sep 2007
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


 
Reply With Quote
 
 
 
 
Keith G Hicks
Guest
Posts: n/a
 
      20th Sep 2007
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" <(E-Mail Removed)> wrote in message
news:eu9oe95#(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Jay Freedman
Guest
Posts: n/a
 
      20th Sep 2007
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/Format...thSections.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" <(E-Mail Removed)> wrote in message
> news:eu9oe95#(E-Mail Removed)...
>> 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



 
Reply With Quote
 
Suzanne S. Barnhill
Guest
Posts: n/a
 
      20th Sep 2007
This is easiest to do in Normal view. Select all the text from just after
the section break that begins the section up to and including the section
break that ends the section. Press Delete.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

"Keith G Hicks" <(E-Mail Removed)> wrote in message
news:uE0Vw$6%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:eu9oe95#(E-Mail Removed)...
> > 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
> >
> >

>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bullets are applied to entire document, not just section of text =?Utf-8?B?d2F0ZXJjb2xvcg==?= Microsoft Word Document Management 2 17th Oct 2006 09:14 PM
TOC style applied to entire section?? Ed Microsoft Word New Users 5 15th Aug 2006 03:20 AM
How to delete section without deleting the section formatting? =?Utf-8?B?UmFq?= Microsoft Word Document Management 4 27th Dec 2005 11:05 PM
Word 2003 - change font size for one section, entire doc changes =?Utf-8?B?RGFrb3Rh?= Microsoft Word Document Management 1 29th Jun 2005 08:03 PM
how do you select an entire section Chip Orange Microsoft Word New Users 6 14th Mar 2004 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:48 PM.