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 / April 2005

Tip: Looking for answers? Try searching our database.

Remove a section using chkbox

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anauna - 25 Apr 2005 12:38 GMT
Hello, (very new to VBA)

I have a form with textboxes linked to bookmarks in a word template.  My
last item to figure out is coding a couple of check boxes.

I am having difficutly figuring out the code that when a check box is
selected a section (i.e. sec 4) is removed from the word document.  If the
checkbox is unselected the section is left alone.
This will take place under a command button.

Signature

Thank-you and all suggestions are appreciated.

Helmut Weber - 25 Apr 2005 13:19 GMT
Hi Anauna,

do you mean something like this?

Private Sub CommandButton1_Click()

If Me.CheckBox1.Value = True Then
  ActiveDocument.Sections(2).Range.Select ' for testing
  ActiveDocument.Sections(2).Range.Delete
End If

End Sub

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
Anauna - 26 Apr 2005 14:47 GMT
Thank-you very much!

> Hi Anauna,
>
[quoted text clipped - 13 lines]
> "red.sys" & chr(64) & "t-online.de"
> Word 2002, Windows 2000
 
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.