I have a template that has 20 sections that I use daily and need to be able
to delete different sections each time. I am not sure what the best way
would be to set it up but I think that I would like to have a UserForm come
up when the document is opened that would list all of the sections with check
boxes by each. Then I could select the check boxes that go with each section
that I want to keep and then when I exit the user form all of the unchecked
items are deleted.

I am open to different suggestions if there is an easier way.

thanks alot for the help.

Re: using checkbox to delete a section of text by Russ

Russ
Sat Sep 09 14:37:11 CDT 2006

Shawn,

> I have a template that has 20 sections that I use daily and need to be able
> to delete different sections each time. I am not sure what the best way
> would be to set it up but I think that I would like to have a UserForm come
> up when the document is opened that would list all of the sections with check
> boxes by each. Then I could select the check boxes that go with each section
> that I want to keep and then when I exit the user form all of the unchecked
> items are deleted.
>
> I am open to different suggestions if there is an easier way.

I think an easier way would be to set things up to be able to use Outline
view in Word. You would have the pseudo self-labeled sections that can be
expanded and collapsed for more focused viewing and when collapsed, can be
selected and deleted or moved around.

>
> thanks alot for the help.

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID


Re: using checkbox to delete a section of text by rub

rub
Sun Sep 10 01:42:32 CDT 2006

Won't something like this work:

Private Sub CommandButton1_Click()
Dim i As Integer
For i = 20 To 1
If CheckBox(i).Value = True Then
ActiveDocument.Sections(i).Range.Delete
End If
Next
End Sub

You would need to start at the end because once you delete a section
its section # changes.


shawn wrote:
> I have a template that has 20 sections that I use daily and need to be able
> to delete different sections each time. I am not sure what the best way
> would be to set it up but I think that I would like to have a UserForm come
> up when the document is opened that would list all of the sections with check
> boxes by each. Then I could select the check boxes that go with each section
> that I want to keep and then when I exit the user form all of the unchecked
> items are deleted.
>
> I am open to different suggestions if there is an easier way.
>
> thanks alot for the help.