求ppt 表格文本对齐方式为垂直居中vba代码
求ppt 表格文本对齐方式为垂直居中vba代码水平居中我摸索出来了 TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter但是垂直居中一直没思路,也找不到相关的文档,03的录制宏也录不出来
求大佬们指点,万分感激感谢!!!!!!! Sub ppt表格文本居中1()
Dim oRow As Row
On Error Resume Next
For Each oRow In ActiveWindow.Selection.ShapeRange.Table.Rows
For j = 1 To oRow.Cells.Count
'oRow.Cells(j).Shape.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter '水平居中
oRow.Cells(j).Shape.TextFrame.HorizontalAnchor = msoAnchorCenter '水平居中
oRow.Cells(j).Shape.TextFrame.VerticalAnchor = msoAnchorMiddle '垂直居中
Next
Next
End Sub
或:
Sub ppt表格文本居中2()
Dim oRow As Row, oCell As Cell 'Row行 'Column列 'Cell单元格
On Error Resume Next
For Each oRow In ActiveWindow.Selection.ShapeRange.Table.Rows
For Each oCell In oRow.Cells
'oCell.Shape.TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter '水平居中
oCell.Shape.TextFrame.HorizontalAnchor = msoAnchorCenter '水平居中
oCell.Shape.TextFrame.VerticalAnchor = msoAnchorMiddle '垂直居中
Next
Next
End Sub 嗯嗯嗯,真的有用,谢谢大佬,太感谢大佬了,感激涕零,太开心了 Set t = sh.Tablet.Rows(1).Cells.Borders.Item(ppBorderBottom).Weight = 1
如果是用
t.rows(1).+...的方式能表达垂直居中吗? 嗯嗯,还是需要cell
页:
[1]