【发布时间】:2016-10-26 14:19:12
【问题描述】:
我想删除第一张幻灯片中的三个 TextBox。我写了这段代码,但它不起作用!! 这是我的代码:
Sub deleteTextBox()
Dim osld As Slide
Dim oShp As Shape
Dim oShp1 As Shape
Dim oShp2 As Shape
Set osld = ActivePresentation.Slides(1)
For Each oShp In osld.Shapes
If oShp.HasTextFrame Then
If oShp.Left = 20 And oShp.Top = 150 Then
oShp.Delete
End If
End If
Next oShp
For Each oShp1 In osld.Shapes
If oShp1.HasTextFrame Then
If oShp1.Left = 20 And oShp1.Top = 200 Then
oShp1.Delete
End If
End If
Next oShp1
For Each oShp2 In osld.Shapes
If oShp2.HasTextFrame Then
If oShp2.Left = 35 And oShp2.Top = 490 Then
oShp2.Delete
End If
End If
Next oShp2
End Sub
感谢您的帮助
【问题讨论】:
标签: vba macros powerpoint