There are some really good hints in
this node. The key (as pointed out in that node) is to understand the DOM if you want to make an Office tool do stuff. The earlier comment about recording a macro and translating it to perl is also a good idea.
HTH, --traveler
Update: Fixed node id