在word中,如何在光标处插入图片,如果想插入自定义控件的话,哪种可以在word中被保存,并且能正常打开?谢谢!

解决方案 »

  1.   

    private Word.ApplicationClass oWordApplic;
    private Word.Document oDoc;插入图片:
    public void InsertPicture(string picturePath)
    {
          object obj1 = Missing.Value;
          object obj2 = true;
          this.oWordApplic.Selection.InlineShapes.AddPicture(picturePath, ref obj1, ref obj2, ref obj1);
    }插入文件:
    public void InsertFile(string strFileName)
            {
                object missing = System.Reflection.Missing.Value;
                object confirmConversion= false;
                object link = false;
                object attachment = false;
                oWordApplic.Selection.InsertFile(strFileName, ref missing, ref confirmConversion, ref link, ref attachment); 
            }