使用VBA PowerPoint删除单元格边框



这个问题很简单,但我无法在PowerPoint中使用VBA删除表中的表单元格边框。

我想下面的代码应该可以工作,但它什么都不做——有什么线索吗?

没有错误消息,但单元格边框仍然存在。

Sub RemoveCellsBorders()
Set oTbl = ActiveWindow.Selection.ShapeRange.Table

For X = 1 To oTbl.Columns.Count
For Y = 1 To oTbl.Rows.Count

If oTbl.cell(Y, X).Selected Then

oTbl.cell(Y, X).Borders(ppBorderTop).Visible = False
oTbl.cell(Y, X).Borders(ppBorderBottom).Visible = False
oTbl.cell(Y, X).Borders(ppBorderLeft).Visible = False
oTbl.cell(Y, X).Borders(ppBorderRight).Visible = False
End If

Next 'y
Next 'x
End Sub

更改以下代码,然后边框将被删除,由于未知原因,visible = false现在不能在ppt中工作,请确保您已经选择了该表。

If oTbl.Cell(y, x).Selected Then
oTbl.Cell(y, x).Borders(ppBorderTop).Transparency = 1
oTbl.Cell(y, x).Borders(ppBorderBottom).Transparency = 1
oTbl.Cell(y, x).Borders(ppBorderLeft).Transparency = 1
oTbl.Cell(y, x).Borders(ppBorderRight).Transparency = 1
End If 

最新更新