_Application app; //定义一个WORD的应用对象
char str_filename[50] ="12.doc";
Documents docs = app.GetDocuments();
//怎样判断12.doc已经存在,如果存在就继续写入,否则新建后写入
CComVariant Template(_T(str_filename));
CComVariant NewTemplate(false),DocumentType(0),Visible;
docs.Add(&Template,&NewTemplate,&DocumentType,&Visible);