Vertically center a table cell's contents in PowerPoint using VBA?

B

BryanMWood

I need to vertically center a table cell's contents in Powerpoint
using VBA. I am currently using the line of code below for the
horizontal alignment but I cannot find any property for the vertical
alignment. Please let me know if this is possible. Thanks in
advance.

PPShape.Table.Cell(i,
j).Shape.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter
 
S

Steve Rindsberg

I need to vertically center a table cell's contents in Powerpoint
using VBA. I am currently using the line of code below for the
horizontal alignment but I cannot find any property for the vertical
alignment. Please let me know if this is possible. Thanks in
advance.

PPShape.Table.Cell(i,
j).Shape.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter

Work with the TextFrame's horizontal and vertical anchors, something like this:

with PPShape.Table.Cell(i, j).Shape.TextFrame
.HorizontalAnchor = msoAnchorCenter
.VerticalAnchor = msoAnchorMiddle
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top