PDA

View Full Version : Merged cell horizontal alignment



Novio
01-15-2013, 01:55 AM
Hallo,

I have a question. How can I the merged Cells (1, 1) MergTo Cells (4, 1) horizontal align?

Sub TableAddIn()
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=5, _
NumColumns:=3
With Selection.Tables(1)
.Columns.First.Width = CentimetersToPoints(5.5)
.Columns.Last.Width = CentimetersToPoints(6)
.Rows.HeightRule = wdRowHeightAtLeast
.Rows.Height = CentimetersToPoints(0.5)
.Cell(1, 1).Merge _
MergeTo:=.Cell(4, 1)
.Cell(4, 2).Merge _
MergeTo:=.Cell(4, 3)
.Cell(5, 2).Merge _
MergeTo:=.Cell(5, 3)
With .Cell(4, 2)
.HeightRule = wdRowHeightExactly
.Height = CentimetersToPoints(4)
End With
.Cell(1, 2).Width = CentimetersToPoints(4)
.Cell(2, 2).Width = CentimetersToPoints(4)
.Cell(3, 2).Width = CentimetersToPoints(4)
.Cell(4, 2).Width = CentimetersToPoints(10)
.Cell(5, 2).Width = CentimetersToPoints(10)
With .Cell(1, 1)
.VerticalAlignment = wdCellAlignVerticalCenter
End With
End With
End Sub

Kind regards

Mark

fumei
01-15-2013, 03:47 PM
I do not understand what you are asking.

Novio
01-16-2013, 12:56 AM
Hello Fumei

I have Merged a few cells. This is now a one cell. And this cell has to be horizontal alignment.

Kind regards

Mark