如何在D7中调用word文档

解决方案 »

  1.   

    在servers组件里面有WORD控件.
    wordDocument:建立word文件方档.
    wordApplication启动WORD并建立同WORD的连接.
      

  2.   

    用OLEObject也可以.
    Var
        VarWord: Variant;
    begin
        try
            // Create word OleObject
            VarWord:=CreateOleObject('word.basic');
            // Create a new document
            VarWord.FileNew;
          // Zoom To 75% 
            VarWord.ViewZoom75;
            VarWord.ViewPage; 
    //Center Alignment
            VarWord.CenterPara; 
            Varword.font('MS Sans Serif'); 
            VarWord.FontSize(14); 
    //Export text
            varword.insert(#13+#13+ Edit1.Text+#13+#13+#13);
           
            VarWord.font('MS Serif');
    // you can set the font size 
            VarWord.Fontsize(16);
            VarWord.insert( Edit2.text+#13);
            
            VarWord.LeftPara; 
            VarWord.Font('Times New Roman');
            VarWord.fontSize(14);
            VarWord.Insert(#13+ Edit3.Text+' '+#13);
           
            VarWord.fontSize(14);
            VarWord.Insert( Edit4.Text+#13);
          
            VarWord.RightPara; 
            VarWord.fontSize(14);
            VarWord.Insert( Edit5.Text+#13);
         
            VarWord.StartOfdocument; 
            VarWord.AppMaxiMize; 
            VarWord.AppShow; 
        except
            showmessage('Error! Can''t Save to Microsoft Word.');
        end; //end of try
    end;
      

  3.   

    如果在应用中必须打开再关闭WORD,怎么可以加快调用速度