Powerpoint 仅在幻灯片的一部分上删除形状

Powerpoint Delete Shapes just on a part of a slide

我目前正在尝试使用宏删除幻灯片上的形状(用户绘制并在演示结束时保留的墨迹形状)。它看起来像这样:

Sub EraseInkOnSlide(oSl As Slide)
' Erases any INK shapes drawn by the user and
' retained when the user quits the slide show
    Dim oSh As Shape
    Dim x As Long
    With oSl.Shapes
    For x = .Count To 1 Step -1
        If .Item(x).Type = 23 Then
            .Item(x).Delete
        End If
    Next
    End With
End Sub

现在我只想让宏删除演示文稿的一部分上的墨迹形状,例如幻灯片上的特定方块。

这可能吗,如果可能怎么办?

在史蒂夫的帮助下,我让它开始工作。这是代码:

Sub EraseInkOnSlide(oSl As Slide)
' Erases any INK shapes drawn by the user and
' retained when the user quits the slide show
Dim oSh As Shape
Dim x As Long
With oSl.Shapes
For x = .Count To 1 Step -1
    If .Item(x).Type = 23 Then
        If ((.Item(x).Top >= "square.top") And (.Item(x).Left >= "square.left")) And (.Item(x).Top + .Item(x).Height <= "square.top" + "square.heigth") And (.Item(x).Left + .Item(x).Width <= "square.left" + square.width") Then
        .Item(x).Delete
        End If
    End If
Next
End With
End Sub

"square.x"代表您为方块设置的具体坐标。