We help IT Professionals succeed at work.

Align-right text in PowerPoint table VBA

badrhino
badrhino asked
on
Currently I'm using VBA to add a table and populate it (connecting to database). Everything works perfect.  However,  I need to align right the text in the cells and I haven't been able to find out how to do this.  Obviously It works just find if I find the align right button on the ribbon, but I need to do this using vba.  I can find out how to center it, but not right align.  Currently this is what I have:
                 With .Cell(iRow, iColumn).Shape.TextFrame
                    '.VerticalAnchor = msoAnchorMiddle
                    .HorizontalAnchor = msoAnchorCenter
                End With

Any Ideas?
Comment
Watch Question

John WilsonCEO PowerPoint Alchemy

Commented:
Try

With .Cell(iRow, iColumn, 1).Shape.TextFrame
.TextRange.ParagraphFormat.Alignment = ppAlignRight
End With

Open in new window

CEO PowerPoint Alchemy
Commented:
Apology thats a typo!!

With .Cell(iRow, iColumn).Shape.TextFrame
.TextRange.ParagraphFormat.Alignment = ppAlignRight
End With

Open in new window

Author

Commented:
Works Perfect.  Thanks!