It's a pity that you can't name sections. If you could, you could write:
Activedocument.Sections("Fred").Range.Delete
- and you wouldn't have to worry about section numbers changing. However, if
you put a bookmark in a section you can write:
Activedocument.Bookmarks("bmkS2").Range.Sections(1).Range.Delete
- and that will delete the section regardless of its number.
JCNZ,
How is that an improvement over clicking in the selection and:
Selection.Sections(1).Range.Delete
I mean if you bookmark your sections with bmkS1, bmkS2, bmkS3 etc. then
delete section two using your suggestion the section will be deleted
along with the bookmark. The old section three will become the new
section 2 and contain a bookmark named bkmS3. If you want to delete
section 2 and run your code it will throw and error.
While I appreciate your thoughts on "named" bookmarks, I don't see the
benefit of your proposed solution.
Perhaps I am missing something.
> It's a pity that you can't name sections. If you could, you could write:
>
[quoted text clipped - 49 lines]
> > jmarcilREMOVE@CAPSsympatico.caTHISTOO
> > Word MVP site: http://www.word.mvps.org
Jean-Guy Marcil - 25 Oct 2006 05:59 GMT
Greg Maxey was telling us:
Greg Maxey nous racontait que :
> JCNZ,
>
[quoted text clipped - 12 lines]
>
> Perhaps I am missing something.
Not only that, even more of an issue is that unless you are working with a
protected document, you have to rely on the user not to delete the bookmark
while editing the document...
Never trust a user to not screw something up that can be screwed up....
Murphy's law definitely applies!

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
JCNZ - 29 Oct 2006 05:41 GMT
Greg:
The bookmarks offer an advantage if you want to delete a number of specific
sections at some point in a document's life. They might, for example, contain
explanatory text which wouldn't be required in a final document. Way back,
Pam was '... trying to delete sections 2 then 4-16.' - so it looks as if she
had something like this in mind. You wouldn't have to know the numbers of the
sections, and it wouldn't matter if the user had inserted some sections.
My 'bmkS1', 'bmkS2' and so on weren't intended to suggest that they had to
be in specifically numbered sections. They could equally well have been
'bmkIntro', 'bmkClause123' and so on.
I assume that the programmer would add code to check for the existence of
the relevant bookmarks before the deletion code ran. If the bookmark isn't
there, the code must already have run and it wouldn't be appropriate to run
it again.
> JCNZ,
>
[quoted text clipped - 66 lines]
> > > jmarcilREMOVE@CAPSsympatico.caTHISTOO
> > > Word MVP site: http://www.word.mvps.org
Greg Maxey - 29 Oct 2006 05:49 GMT
Ok, I see what you mean now. That looks to me like a fine and workable
solution to the scenario that you described.

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> Greg:
>
[quoted text clipped - 87 lines]
>>>> jmarcilREMOVE@CAPSsympatico.caTHISTOO
>>>> Word MVP site: http://www.word.mvps.org