Microsoft Office Tutorials and References
In Depth Information
Forms: Inserting a New Table Row
Wrd
Figure 55 – Auto-inserting Table Rows
View the Appendix to learn how to store this procedure
in a Standard module.
Option explicit¶
' * * * * *¶
'If the form has more than one table¶
'set this value to the number of the¶
'table to process with this code¶
Const TableIndex As Long = 1¶
'Name of the AutoText entry that contains¶
'the row that should be inserted¶
Const AutoTextName As String = "NewRow"¶
'Enter the number of rows that should remain¶
'below the row being inserted.¶
'For example, this sample table has one row,¶
'the Totals row, that should stay at the end¶
'This and the password constant are shared¶
'with the DeleteCurrentRow macro¶
Public Const EndRowsIndex As Long = 1¶
'The password to unprotect (leave as is if you're¶
'not assigning a password to the form¶
Public Const password = ""¶
' * * * * *¶
Sub InsertNewTableRow()¶
'Variable declaration¶
Dim doc As Word.Document¶
Dim tmpl As Word.Template¶
Dim tbl As Word.Table¶
Dim lastRow As Long¶
Dim ffldName As String¶
Search JabSto ::




Custom Search