How to add a function to export data to MS Word or Excel