I am struggling to work out how to fix this code. Its Word 2007 VBA
It errors because the cell of the table is selected in its entirety rather than its contents i think. Currently it's
This creates a new row under the the first one and formats it to look nice but errors when trying to enter the date. I have tried using the code in a keyboard enabled macro and it seems to work when I click in the cell but brings the same error when I highlight the whole cell (which lead me to suspect this was the problem)
Any ideas?
It errors because the cell of the table is selected in its entirety rather than its contents i think. Currently it's
Code:
With ActiveDocument.Tables(2)
.Rows.Add BeforeRow:=ActiveDocument.Tables(2).Rows(2)
.Rows(2).Range.Shading.BackgroundPatternColor = wdColorAutomatic
.Rows(2).Range.Borders(wdBorderBottom).LineStyle = wdLineStyleDot
.Cell(2, 2).Range.InsertDateTime "yy.MM.dd", False, wdEnglishUK, wdCalendarWestern, False
End With
Any ideas?