I need to check if a Connector is really connected to a Shape, in other words, does it have any Shape returned by EndConnectedShape. So far I have this, but it gives me an error: Permission denied:
Sub test()
Dim oSh, mySh As Shape
smth = "SomeName"
For Each oSh In ActivePresentation.Slides(1).Shapes
If oSh.Connector And oSh.Name = smth Then
' In the NEXT line the following error is returned:
' oSh.ConnectorFormat.EndConnectedShape = <Permission denied>
Set mySh = oSh.ConnectorFormat.EndConnectedShape
If Not IsEmpty(mySh) Then
oSh.ConnectorFormat.EndConnectedShape.Line.ForeColor.RGB = RGB(255, 0, 0)
End If
End If
Next oSh
End Sub
There must be something very simple, but I can't figure out what I miss. Any suggestions? Thanks!