Like Skip said, you're posting in the wrong section, but since I'm a CATIA user - one way you can trigger a macro to run when a part opens is by using a reaction. You'll need the KWA workbench to create it and you can trigger a script to run on certain events - like onload.