![]() |
|
#1
|
|||
|
|||
|
Hi,
I was trying to work on a Word Document. I have created various dropdown fields in the form. I need a functionality to delete specific tables when a certain dropdown is selected. For example: I have a dropdown field which is named "Parent1" and the dropdown options are Yes and No. I want to delete tables 10 to 14 if the option "No" is selected. I have entered the following code but it is only accepting one condition. Sub Parent() ActiveDocument.Unprotect Select Case ActiveDocument.FormFields("Parent1").Result Case "No": ActiveDocument.Tables(10).Delete End Select ActiveDocument.Protect wdAllowOnlyFormFields, True End Sub But this code can delete only 1 table. I am new to VBA, need help. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro to delete all empty rows from all tables
|
braddgood | Word VBA | 15 | 10-02-2015 01:54 PM |
| Excel to Word and delete certain tables | jon12355 | Word VBA | 10 | 10-15-2014 03:01 PM |
IF field + Drop-Down list
|
nightkn8 | Word | 2 | 07-02-2014 02:42 AM |
Form Field Drop Down List
|
James Ayers | Word | 3 | 07-14-2013 07:53 PM |
using checkboxes to delete tables
|
atfresh | Word Tables | 1 | 06-19-2011 09:13 PM |