We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting vertical text in table cell?

Trying to set the text to vertical in a cellEx:

Dim cell as new CellEx
cell.TextVerticalType = TextVerticalTypeEx.Vertical

This does not orient the text vertically at all, it remains horizontal. This and this say it should behave differently.


Dear James,

You may align the text inside the cell using CellEx.TextVerticalType property. Please use the code snippet given below to add adjust the text vertically. There can be other that can be set and observed and selected to suite your requirement. I have used Aspose.Slides for .NET 4.2.0.

'Instantiate PresentationEx class that represents PPTX file<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Dim pres As New PresentationEx()

'Access first slide

Dim sld As SlideEx = pres.Slides(0)

'Define columns with widths and rows with heights

Dim dblCols() As Double = {50, 50, 50}

Dim dblRows() As Double = {50, 30, 30, 30, 30}

'Add table shape to slide

Dim idx As Integer = sld.Shapes.AddTable(100, 50, dblCols, dblRows)

Dim tbl As TableEx = CType(sld.Shapes(idx), TableEx)

'Set border format for each cell

For Each row As RowEx In tbl.Rows

For Each cell As CellEx In row

cell.BorderTop.FillFormat.FillType = FillTypeEx.Solid

cell.BorderTop.FillFormat.SolidFillColor.Color = Color.Red

cell.BorderTop.Width = 5

cell.BorderBottom.FillFormat.FillType = FillTypeEx.Solid

cell.BorderBottom.FillFormat.SolidFillColor.Color = Color.Red

cell.BorderBottom.Width = 5

cell.BorderLeft.FillFormat.FillType = FillTypeEx.Solid

cell.BorderLeft.FillFormat.SolidFillColor.Color = Color.Red

cell.BorderLeft.Width = 5

cell.BorderRight.FillFormat.FillType = FillTypeEx.Solid

cell.BorderRight.FillFormat.SolidFillColor.Color = Color.Red

cell.BorderRight.Width = 5

Next cell

Next row

'Merge cells 1 & 2 of row 1

tbl.MergeCells(tbl(0, 0), tbl(1, 0), False)

tbl(0, 0).TextFrame.Text = "Merged Cells"

tbl(0, 0).TextVerticalType = TextVerticalTypeEx.Vertical

'Write PPTX to Disk

pres.Write("d:\table.pptx")

Thanks and Regards,