INFO: Using Visual C++ to Automate Office
http://support.microsoft.com/kb/238972/en-us
How to create an automation project using MFC and a type library
http://support.microsoft.com/kb/178749/EN-US/
How To Use WordBasic Functions in an MFC Automation Client for Word 97, Word 2000, Word 2002, or Word 2003
SUMMARY
This article demonstrates how to automate Microsoft Word from an MFC Automation client, and call WordBasic functions.
http://support.microsoft.com/kb/252719/en-us