Thanks Shuping,
Yes, in my code, I didn't include line: pElement = graphicsContainer.Next(); in the while loop.
In your code, you selected shapes of the pagelayout, right ? Is it ok if you add and select shapes within the Focus Map (MapFrame) of the pagelayout ?
Kind regards,