I think it needs a really complicated makro, that also refers to outside programs.. This CAN be accomplished using VBA in the Visual Basic Editor... But it's pretty hard.. Myself I am not so good with scripting.. so I don't think i can help you..
All I can say, is that it's possible. And I hope it helps you knowing that it's possible.
If you have the time, you can ofcourse expand your knowenge, and study VBA scripting.
Might be handy in other applications ass well
Here is a link to get started!
http://msdn.microsoft.com/en-us/library/aa218785.aspx