run macro when saving part file!

Hi,

how can I run a macro when I am saving or rebuilt the Part file?

I am beginner in API

Thanks

Zaher

SolidworksApi macros