Hi, I'm an intern at a law firm in China, and I'm writing a program to help it calculate the bills that it issues to its clients. (The lawyers there usually do it manually!) I'm a beginner in C++, so I only know how to use very basic file I/O from text files (the law firm uses Word to issue bills), and although I already finished writing the program, it requires that the numbers and words are first pasted into a notepad file, saved, then after running the program you have to open up another notepad file, copy the results and then paste them back into Word! It would be nice if I could somehow write a macro that would do all of this, or just a separate program that could open up the Word file instead of all these notepad files.... but I don't know how to do it. Especially since Office macros use Visual Basic. Can anyone please help?

Could you use mail merge? You put your data from your C++ program into a particular format and let word merge the data into a template?

In word, look in help for "mail merge data sources" or use the Select Data Source... dialog box for help on what format(s) word supports for the external data file.