>>>>Hi Jim,
>>>>
>>>>check out Rick Strahl's West Wind Client Tools, it has a CopyObject function.
http://www.west-wind.com/wwClientTools.asp>>>>
>>>He uses similar idea, but the code is more robust. However, this code would not bring methods and events.
>>
>>What do you mean? AFAIK CopyObject copies ALL the PEMs.
>
>I just read the code, but I see, that only properties are copied. If you have custom code in methods, this would not be automatically copied. In order to copy the object with the custom code you have to create a class with all code defined. At least that's the idea that I would use to implement it, if I face this requirement.
It looks like you are right. I have never used this function, but I was sure it also copied all the event and method code, but it obviously does not.