This step-by-step guide explains how you can write your own add-ons for Google Docs and Google Spreadsheets.
The Google Apps Script code used in the tutorial can be found at http://labnol.org/?p=28446
Contact the Apps Script Developer at http://ctrlq.org/