![]() |
|
#10
|
||||
|
||||
|
Yes, you can use Content Controls for a form. The attached works with or without the restrictions that apply to forms protection or the docx/m-format editing restrictions. It is currently configured for the latter. Simply exiting the last content control in the table will trigger the prompt that asks whether to add a new row. The dropdowns are presently not populated but, if you populate them, you'll see that their selection options are replicated when you add a new row.
To insert the new row immediately above the last row in the table, you could modify the ContentControlOnExit macro in the document by inserting: 'Break the table before the last row .Last.Range.InsertBreak wdColumnBreak after: With Selection.Tables(1).Rows and deleting or commenting-out: .Next.InsertBefore vbCr With that change, the penultimate table row will be replicated. Note: As coded, you'll get two prompts if you answer 'no' to the addrow question if you click on another content control when exiting the last one in the table. If that annoys you, you could delete the lines: Code:
'Exit if we're not in a table - we don't really need this is using a bookmarked table, ' but it's a safeguard against the bookmark having been expanded/moved. If CCtrl.Range.Information(wdWithInTable) = False Then Exit Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Macro help sought for Word table
|
xan | Word VBA | 1 | 04-20-2012 07:50 PM |
Create Table Form from Word Document
|
gsj224 | Word VBA | 3 | 07-31-2011 09:26 AM |
Word Macro That Checks a Check Box Form Field When File Print is Executed
|
DKerne | Word VBA | 4 | 06-09-2011 11:54 AM |
| Do I need a Form or a Macro?? | Keith24249 | Excel | 0 | 08-23-2010 06:23 AM |
| Use Form Checkbox to Add Table | laxonator | Word Tables | 0 | 10-23-2008 06:21 AM |