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

Free Support Forum - aspose.com

Modify vertical alignment of text in a cell of a table

In the following code snippet I horizontally center the cell text in a table. How do I vertically align the text (top, center, bottom)?

Thank you.

var fis = new System.IO.FileStream(MapPath(".") + "\\template.ppt", System.IO.FileMode.Open, System.IO.FileAccess.Read);
var pres = new Presentation(fis);

TextFrame tf;
tf = pres.Slides[7].FindShape("table").GetCell(1, 0).TextFrame;
var para = tf.Paragraphs[0];
para.Alignment = TextAlignment.Center;

Hello Dear,

Aspose.Slides for .NET allows you to rotate the text inside the text frame and set it vertical. Please use the following code snippet line to set the text direction vertical. Please follow this link for neccessary details.


Thanks and Regards,

Thank you. I think I might find this useful in the future.

For this case I was thinking of the vertical alignment of the text as it relates to the border.

For instance:

Top Align text is closer to the top border

Top Align


Bottom Align text is closer to the bottom border


Bottom Align

Attached image does a better job of presenting this.

Hello Dear,

The vertical text alignment is associated with AnchorText property of the TextFrame. Please visit this documentation link for further information. Please follow this thread link where you will find the example of vertical text alignment.

Thanks and Regards,

Exactly what I needed.

Thanks for your help.