I want to create shapes using vba in powerpoint that cannot be edited manually (move, resize, change color...).

Even if with vba cannot be edited but can be deleted is enough for me. Is there any way to create that kind of non editable shapes in powerpoint?

I read some thread that talks about protected shapes in excel but in powerpoint I cannot use myShape.protect.

有帮助吗?

解决方案

I finally manage to make it this way:

Public Sub PPTApp_WindowSelectionChange(ByVal Sel As Selection)
    On Error GoTo NoShape
    If Sel.ShapeRange.name = "arrow" Then
        ActiveWindow.Selection.Unselect
    End If
NoShape:
    If Err.Description <> "" Then
        Err.Clear
    End If
End Sub

Maybe is not the best way... but at least it works. Hope that it will work for anyone. And If someone knows a better way please let me know posting it here.

其他提示

You can only do this in XML not vba.

There's a simple example of a locked shape here. You can look at the XML to see how it was done.http://www.pptalchemy.co.uk/Downloads/noMove.pptx

If you have no idea how to do this Chirag Dahl has a fairly cheap addin to do it for you.

http://officeone.mvps.org/shapelocker/shapelocker.html

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top