When I write a macro, I am usually using a loosely typed object so the type is not fully known. Even worse, based on the execution path, the object type may be completely different than expected. Unless your variables are explicitly stated as to type, it would likely not be possible to implement.