Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Forms and tables
I would like to have a form with a table in it. However, I am not sure how
many rows the table will need. Is the some trick to having a table dynamically add to itself (with the form field of the above row)? Thanks F |
#2
|
|||
|
|||
Have the following macro run on exit from the last formfield in the table:
Sub addrow() ' ' 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.Table s(1).Rows.Count, ActiveDocument.Tables(1).Columns.Count).Range.Form Fields(1).ExitMacro = "addrow" ActiveDocument.Tables(1).Cell(ActiveDocument.Table s(1).Rows.Count, 1).Range.FormFields(1).Select ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True End Sub -- 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 "FredEp57" wrote in message ... I would like to have a form with a table in it. However, I am not sure how many rows the table will need. Is the some trick to having a table dynamically add to itself (with the form field of the above row)? Thanks F |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automated forms | Microsoft Word Help | |||
printing empty text fields on word forms | Microsoft Word Help | |||
Word Forms | Microsoft Word Help | |||
Caption numbering problem in TOC | Formatting Long Documents | |||
Lines in forms to type on | Microsoft Word Help |