If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Form Fields and Tables
Can a table in a locked form be formatted so that a particular key (tab in
regular tables) will add more lines (rows)? |
#2
|
|||
|
|||
Form Fields and Tables
Here is a macro that when run on exit from the last formfield
in the last row of a table will add another row to the table, inserting formfields into the cells. In this case, there are 5 columns in the table and text formfields are added to the first three cells and dropdown formfields are added to the final two. You may get some ideas from this. Dim rownum As Integer, i As Integer With ActiveDocument .Unprotect .Tables(1).Rows.Add rownum = .Tables(1).Rows.Count For i = 1 To 3 .FormFields.Add Range:=.Tables(1).Cell(rownum, i).Range, Type:=wdFieldFormTextInput Next i .FormFields.Add Range:=.Tables(1).Cell(rownum, 4).Range, Type:=wdFieldFormDropDown With .Tables(1).Cell(rownum, 4).Range.FormFields(1).DropDown.ListEntries .Add "Item1" .Add "Item2" .Add "Item3" .Add "Item4" .Add "Item5" End With .FormFields.Add Range:=.Tables(1).Cell(rownum, 5).Range, Type:=wdFieldFormDropDown With .Tables(1).Cell(rownum, 5).Range.FormFields(1).DropDown.ListEntries .Add "ItemA" .Add "ItemB" .Add "ItemC" .Add "ItemD" .Add "ItemE" End With .Tables(1).Cell(rownum, 5).Range.FormFields(1).ExitMacro = "addrow" .Tables(1).Cell(rownum, 1).Range.FormFields(1).Select .Protect Type:=wdAllowOnlyFormFields, NoReset:=True End With -- 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 "Carla" wrote in message ... Can a table in a locked form be formatted so that a particular key (tab in regular tables) will add more lines (rows)? |
Thread Tools | |
Display Modes | |
|
|