toggle selected nodes between smooth or cusp

Hello,

I'm trying to write to write a macro which toggles the node between smooth or cusp.

Below code is intended to work on all selected nodes, but it only works on single node.

Sub toggleCusp_Smooth()
Dim s As Shape, n As Node

Set s = ActiveShape
For Each n In s.Curve.Nodes
If n.Selected Then 
If n.Type = cdrCuspNode Then
n.Type = cdrSmoothNode
ElseIf n.Type = cdrSmoothNode Then
n.Type = cdrCuspNode
End If
End If
Next n
End Sub

Thanks.