贴出你调用WORD文档的部分代码看看。

解决方案 »

  1.   

    _Application oWord;
    Documents oDocs;
    _Document oDoc;
    Selection oSelection;
    Paragraphs oParagraphs;
    Tables oTables;
    Table oTable;
    Range oRange;
    Columns oColumns;
    Column oColumn;
    Rows oRows;
    Row oRow;
    Documents oDocument;
    Shapes oShapes;
    Shape oShape;
    Cells oCells;
    Cell oCell; 
    Shading oShading;
    COleVariant vtOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR),
            vtTrue((short)TRUE),
    vtFalse((short)FALSE);
    CString StrToAdd;
    CString str;
    if (!oWord.CreateDispatch("Word.Application")) {
    AfxMessageBox("Æô¶¯wordʧ°Ü£¡!");
    }
    else 
    {
    oWord.SetVisible(TRUE);
    oDocs = oWord.GetDocuments();
    .........
    }