Quote:
Originally Posted by gmayor
Based on your screenshot
Code:
Private Sub CommandButton1_Click()
Dim oCC As ContentControl
Dim oTable As Table
Dim oRng As Range
Set oTable = ActiveDocument.Tables(1)
For Each oCC In oTable.Range.ContentControls
oCC.LockContentControl = False
Next oCC
oTable.Rows.Last.Range.Copy
Set oRng = oTable.Range
oRng.Collapse 0
oRng.Paste
oRng.ContentControls(1).DropdownListEntries.Item(1).Select
For Each oCC In oTable.Range.ContentControls
oCC.LockContentControl = True
Next oCC
Set oCC = Nothing
Set oTable = Nothing
Set oRng = Nothing
End Sub
Private Sub CommandButton2_Click()
Dim oCC As ContentControl
Dim oTable As Table
Set oTable = ActiveDocument.Tables(1)
For Each oCC In oTable.Range.ContentControls
oCC.LockContentControl = False
Next oCC
oTable.Rows.Last.Delete
For Each oCC In oTable.Range.ContentControls
oCC.LockContentControl = True
Next oCC
Set oCC = Nothing
Set oTable = Nothing
End Sub
|
Thanks for the response, this worked like a charm. I am experiencing issues when I try to restrict the form and to only allow fill out information in certain fields. When I lock the form and click add or remove row I receive the following;
Run time error '4605', This command is not available.
Based on the your previous posting on other links, I saw that you had a code regarding restrictions of form editing. I am guessing there has to be a code for password. I am trying to figure out how to apply this. Would be able to help me again?