I'm trying to add a row to a table. How can I add a date picker to one of the cells?
That's a part of the code that I have a problem with:
Code:
Sub addR()
Dim oTable As Table
Dim oCell As Cell
Dim oNewRow As Row
Dim oCCtrl As ContentControl
' Insert new row
Set oTable = ActiveDocument.Tables(1)
Set oNewRow = oTable.Rows.add
For Each oCCtrl In ActiveDocument.ContentControls
With oCCtrl
If .Type = wdContentControlDate Then oNewRow.Cells(1).Range.Text = ""
End With
Next oCCtrl
End Sub
I'm not sure if I'm on the right path, but I would be grateful for any suggestions.
Thanks!