參考:
http://www.microsoft.com/china/msdn/library/dnexcl2k2/html/odc_offcs.asp

解决方案 »

  1.   

    public class CCWordApp 
    {
    private Word.ApplicationClass oWordApplic; // a reference to Word application
    private Word.Document oDoc; // a reference to the document


    public CCWordApp()
    {

    oWordApplic = new Word.ApplicationClass();
    }
    public void Open( string strFileName)
    {
    object fileName = strFileName;
    object readOnly = false;
    object isVisible = true;
    object missing = System.Reflection.Missing.Value; oDoc = oWordApplic.Documents.Open(ref fileName, ref missing,ref readOnly, 
    ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, 
    ref missing, ref missing, ref isVisible,ref missing,ref missing,ref missing); oDoc.Activate();
    }
      

  2.   

    http://expert.csdn.net/Expert/topic/1985/1985562.xml?temp=.7116815
      

  3.   

    先在模板里面定义DocVariable,然后下面的代码
    Set objWd = CreateObject("Word.Application")
    Set objDoc = objWd.Documents.Open(App.Path + "\fawen.doc")
    objWd.Visible = True
    objDoc.Variables("zi").Value = "123"
    objDoc.Variables("hao").Value = "456"
    objDoc.Variables("pifu").Value = "789"
    objDoc.Fields.Update
    objDoc.Save
    Set objDoc = Nothing
    Set objWord = Nothing
      

  4.   

    怎么样在模板里定义这个“DocVariable”,请高手指点
      

  5.   

    前面的各位已经说得比较清楚了。
    如果你自己要添加数据的话,你自己的使用word的对象一个一个操作了
      

  6.   

    Word Xp里面是“插入--域”然后里面可以找到DocVariable,自己再定义一个名字及可