C# automation app cannot access Shapes array items

Hello,

I am writing a C# (.Net) app to auto create a CorelDraw document, by copying and pasting shapes from a document containing master copies of shapes, into a new document.

I have a simple VBA script that does this. And now I am trying to convert it to C# but I cannot get it to find the shapes from the Shapes array of the layer in the master document.

i keep getting error "Argument out of range".  The code is:

string myShapeName = "round_green";

CorelDRAW.Shape myShape = masterDoc.Pages[0].Layers["Images"].Shapes[myShape];

Can anyone help with this?

Kind Regards

Tim