I want to create a form in Word that has a table with Text Fields, drop-down
lists, date formatting, etc. but I also want to give the user of the template
the ability to add rows to the table if necessary to input more data. This
can probably be done with scripting, and I'm willing to do that, but would
like some example scripts and guidance, or, even better, a way to do it
without scripting. I want to lock the template so the users can only enter
data in the designated areas but want a "dynamic table" for part of the data.
Doug Robbins - 07 Sep 2005 05:10 GMT
' Macro created 02/02/03 by Doug Robbins
' To add a new row to a table containing formfields in every column
' automatically on exit from the last cell in the present last row of the
table
Dim rownum As Integer, i As Integer
ActiveDocument.Unprotect
ActiveDocument.Tables(1).Rows.Add
rownum = ActiveDocument.Tables(1).Rows.Count
For i = 1 To ActiveDocument.Tables(1).Columns.Count
ActiveDocument.FormFields.Add
Range:=ActiveDocument.Tables(1).Cell(rownum, i).Range,
Type:=wdFieldFormTextInput
Next i
ActiveDocument.Tables(1).Cell(ActiveDocument.Tables(1).Rows.Count,
ActiveDocument.Tables(1).Columns.Count).Range.FormFields(1).ExitMacro =
"addrow"
ActiveDocument.Tables(1).Cell(ActiveDocument.Tables(1).Rows.Count,
1).Range.FormFields(1).Select
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I want to create a form in Word that has a table with Text Fields,
>drop-down
[quoted text clipped - 8 lines]
> data in the designated areas but want a "dynamic table" for part of the
> data.