Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.pagelayout
Carla Carla is offline
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.word.pagelayout
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Text Form Fields in Word Tables Jill Bailey Tables 1 August 8th 06 04:47 PM
Auto fill Form Fields from previous Variable fields? OmaScott Microsoft Word Help 3 July 19th 06 09:09 PM
MS Word form fields versus mail merge fields [email protected] Mailmerge 4 March 4th 06 05:31 PM
Form fields versus mail merge fields [email protected] Microsoft Word Help 2 February 16th 06 02:12 PM
Form Fields in Tables Patti B Tables 3 July 8th 05 04:11 PM


All times are GMT +1. The time now is 04:54 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"