1。用 c# 2005 如何实现在word文档中的指定位置插入现有的图,图片(或者图像)?
2。如何用c# 2005 在word文档中绘制柱状图,折线图,饼图等,并且实现标注?

解决方案 »

  1.   

    花了2天时间自己搞定了。//省略了word的引用,以下为关键代码
    string fileName = "c://msdn.bmp";  //要插入的图片
    Object oMissed = doc.Paragraphs[2].Range; //插入的位置,替换第二段内容
    Object oLinkToFile = false;  //缺省
    Object oSaveWithDocument = true;//缺省
    doc.InlineShapes.AddPicture(fieldName, ref  oLinkToFile, ref  oSaveWithDocument, ref  oMissed);  //doc为活动文档的名称,即正在操作的文档
      

  2.   

    推荐一个文章:
    《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