Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

using checkbox to delete a section of text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
shawn - 09 Sep 2006 16:15 GMT
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.
Russ - 09 Sep 2006 20:37 GMT
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
[quoted text clipped - 5 lines]
>
> 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.

Signature

Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID

rub - 10 Sep 2006 07:42 GMT
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.

> 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
[quoted text clipped - 7 lines]
>
> thanks alot for the help.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.