View Single Post
 
Old 06-08-2018, 08:40 AM
d4okeefe d4okeefe is offline Windows 10 Office 2016
Advanced Beginner
 
Join Date: Apr 2013
Posts: 77
d4okeefe is on a distinguished road
Default

To clear contents of the tables, I think you have to use a for loop, accessing each cell. Something like this:
Code:
    Dim t As Table
    Set t = ActiveDocument.Tables(1)
    Dim i As Integer, j As Integer
    For i = 1 To t.Rows.count
        For j = 1 To t.Columns.count
            t.Cell(i, j).Range.Text = ""
        Next j
    Next i
You may not need this though. You could just use a template, or a dotx file. The original would always have a cleared table. However, the user-filled doc would need to be saved somewhere.
Reply With Quote