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
|
|||
|
|||
automatically format table rows
I'm using Word 2003/SP2. I'm creating a table in which all the rows are
identical - the cells within each row are formatted with form fields (text boxes, check boxes, etc) The table also has borders, page borders, and shading. This table will be distributed to users to fill in the blanks. My problem is that each user will need a different number of rows and I would like the user to be able to automatically add new formatted rows (including the form fields) when they tab through the last cell in the table. By leaving the table unlocked I can get a new row added but I don't know how to automatically include the form fields. Thanks for any help you can give me! |
#2
|
|||
|
|||
automatically format table rows
This will require modification for your particular case if you have things
other than text formfields: 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 "Mikki" wrote in message ... I'm using Word 2003/SP2. I'm creating a table in which all the rows are identical - the cells within each row are formatted with form fields (text boxes, check boxes, etc) The table also has borders, page borders, and shading. This table will be distributed to users to fill in the blanks. My problem is that each user will need a different number of rows and I would like the user to be able to automatically add new formatted rows (including the form fields) when they tab through the last cell in the table. By leaving the table unlocked I can get a new row added but I don't know how to automatically include the form fields. Thanks for any help you can give me! |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Q: Automatically adding form fields to new rows in table | Richard J | Tables | 1 | December 29th, 2005 03:10 PM |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Update - If statement | Dan @BCBS | Running & Setting Up Queries | 13 | December 14th, 2004 06:02 PM |
Manual line break spaces on TOC or Table of tables | Eric | Page Layout | 9 | October 29th, 2004 04:42 PM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |