If something saves the file, then this function you can get.
If the program is written in C# that use some sort of dekompiler for example dot peek
And look for the method handler on the save button.
In case another language is much harder. IDA pretty well shows system calls for example