Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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
Posted to microsoft.public.word.pagelayout
|
|||
|
|||
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)? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Text Form Fields in Word Tables | Tables | |||
Auto fill Form Fields from previous Variable fields? | Microsoft Word Help | |||
MS Word form fields versus mail merge fields | Mailmerge | |||
Form fields versus mail merge fields | Microsoft Word Help | |||
Form Fields in Tables | Tables |