yes, but I was unable to use that code. When I right clicked the last cell in the last row, then properties, there was nothing listed to run on exit. Here's the code:
Option Explicit
Dim bLastCell As Boolean
Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl)
With Selection.Range
If .Information(wdWithInTable) Then
'To limit processing to a particular table, change:
' Selection.Tables(1).Range below, to:
' ActiveDocument.Tables(#).Range, where # is the table index.
With ActiveDocument.Tables(2).Range
If Selection.Cells(1).RowIndex = .Cells(.Cells.Count).RowIndex Then
If Selection.Cells(1).ColumnIndex = .Cells(.Cells.Count).ColumnIndex Then
bLastCell = True
End If
End If
End With
End If
End With
End Sub
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim CCtrl As ContentControl, Prot As Variant, Pwd As String
If bLastCell = True Then
If MsgBox("Add new row?", vbQuestion + vbYesNo) = vbYes Then
With ActiveDocument
Prot = .ProtectionType
If .ProtectionType <> wdNoProtection Then
Pwd = "GRIN" 'Insert password here
Prot = .ProtectionType
.Unprotect Password:=Pwd
End If
With Selection.Tables(1).Rows
With .Last.Range
.Copy
.Next.InsertBefore vbCr
.Next.Paste
End With
For Each CCtrl In .Last.Range.ContentControls
With CCtrl
If .Type = wdContentControlCheckBox Then .Checked = False
If .Type = wdContentControlRichText Or .Type = wdContentControlText Then .Range.Text = ""
If .Type = wdContentControlDropdownList Then .DropdownListEntries(1).Select
If .Type = wdContentControlComboBox Then .DropdownListEntries(1).Select
If .Type = wdContentControlDate Then .Range.Text = ""
End With
Next
End With
.Protect Type:=Prot, Password:=Pwd
End With
End If
bLastCell = False
End If
End Sub
End Sub