How to Change Column Width for All Word Tables at Once

6

I have a lot of (> 200) tables in Word that have the same layout (two columns, six rows).

I need to adjust the column widths for all of them. Is there a way to automate this?

countermode

Posted 2014-11-11T11:00:55.013

Reputation: 851

Answers

7

You could use a VBA macro to resize every table.

Press ALT+F11 in Word and insert the macro under Project ยป ThisDocument.
Execute the code with F5

Sub resizeTables()    
  For Each Table In ActiveDocument.Tables
    On Error Resume Next
    Table.Columns(1).Width = 200
    Table.Columns(2).Width = 300
    On Error GoTo 0
  Next    
End Sub
  • Columns(2) represents the column 2 in every table
  • The value Width = 300 is your desired width in pixel. Change it to your needs
  • If your table has less columns than your VBA macro, you will get an exception. For this, I added On Error Resume Next to ignore errors and On Error GoTo 0 to stop this error handling

nixda

Posted 2014-11-11T11:00:55.013

Reputation: 23 233