For COM scripting with Word and Excel, I would suggest to use the Macro recorder. It gives you most of the code that you can use in your script.