Hi
I need to create a macro that inserts a table with 3 columns and 4 rows. The
problem is not creating the table with 3 columns and 4 rows, the problem is
how to define the size (or column width) of each column.
If I try to record a new macro I am not allowed to change the table
properties.
Does anyone have a solution to this problem?
David Sisson - 28 Jun 2007 14:18 GMT
Hi Lasse,
Sub SetupTable()
Dim aDoc As Document
Dim aTable As Table
Set aDoc = ActiveDocument
Set aTable = aDoc.Tables.Add(Range:=Selection.Range, NumRows:=5,
NumColumns:=5)
With aTable
.Columns(1).Width = InchesToPoints(1.75)
.Columns(2).Width = InchesToPoints(1.5)
.Columns(3).Width = InchesToPoints(1.25)
.Columns(4).Width = InchesToPoints(1)
.Columns(5).Width = InchesToPoints(1.5)
End With
End Sub