I'm trying to move a selected shape from one layer to another. Instead, all I can do is to add the 2nd layer to the existing layers of the shape.

[vba]Sub MoveToLayer()
Dim shp As Shape
Set shp = ActiveWindow.Selection.Item(1)
ActivePage.Layers("Weldments N Trailing End").Add shp, 0
End Sub
[/vba] After running this code, the selected shape is shown as having "multiple layers", including the original layer.

The help for Add in this context reads:

expression.Add(SheetObject, fPresMems)

expression A variable that represents a Layer object.


Name Required/Optional Data Type Description

SheetObject Required (IVSHAPE) The new Shape object added to the Layer object.
fPresMems Required Integer Zero to remove subshapes from any previous layer assignments; non-zero to preserve layer assignments

Visio 2007 on Windows 7, BTW.