我用C#操作 word 模板(dot文件),模板文件是设计好的,其中有一些内容动态变化,我怎么用c#将动态内容写入模板文件?谢谢!

解决方案 »

  1.   

    string content = wordDocument.Content.Text;
    content.Replace("[ID]", "123");
    如果是多条记录,则需要查找每个字段。
      

  2.   

    我在 dot 文件中怎么设置"标签"呢? 谁能给出用标签操作的步骤? 谢谢!
      

  3.   

    将光标定位在所要插入标签出,点击word插入-》书简-添加书简的名称
      

  4.   

    推荐一个文章:
    《Understanding the Word Object Model from a .NET Developer's Perspective》
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/wordobject.asp