《添加引用》——>《COM》——Microsoft Word 11.0 Object Library后,在一个按钮事件里添加如下代码,为什么在word里画的表在文字前边。
            object missing = Type.Missing;
            object iStart = 0;
            object iEnd = 0;
            Microsoft.Office.Interop.Word.Application app1 = new Microsoft.Office.Interop.Word.Application();
            app1.Visible = true;
            Microsoft.Office.Interop.Word.Document doc1 = app1.Documents.Add(ref missing, ref missing, ref missing, ref missing);
            Microsoft.Office.Interop.Word.Range rng1 = doc1.Range(ref iStart, ref iEnd);            rng1.Text = "\n文字\n\n";
            Microsoft.Office.Interop.Word.Table table = rng1.Tables.Add(app1.Selection.Range, 3, 3, ref missing, ref missing);
            table.Cell(1, 1).Range.Text = "lllll";
            table.Cell(1, 2).Range.Text = "22222";
            table.Cell(1, 3).Range.Text = "33333";最重要的一个问题,如果想把vs里的图片画到word里,应该怎样?
还有可以控制文字写到文本框吗?????

解决方案 »

  1.   

    up~~who can help me!!!!!!!!!
      

  2.   

    1、把Image存到磁盘上
    2、doc1.InlineShapes.Add(ref filePath, ref missing,...............)
    3、delete磁盘图片文件目前我知道的就这种方法
      

  3.   

    http://topic.csdn.net/u/20070720/17/c24c39f5-2e1e-40d0-be5f-00671f97022a.html插入文本框的
      

  4.   

    用你说的方法我已经实现了,谢谢。本来我自己想做的是直接从数据库里把图片调用出来,现在就换这种方法了。 还有我很奇怪,为什么在Word里输出来的是从后边输出的呢??
      

  5.   

    借VS2010东风,CSDN为啥不搞一个VSTO版快!!!!【VSTO之家】
    http://vsto.5d6d.com【VSTO专家群】109033523
    【VSTO】数据获取
    【VSTO】对象起源
    【VSTO】MSDN
    【VSTO】Backstage View
    【VSTO】名人堂
    【VSTO】案例
    【VSTO】MOSS
    【VSTO】Excel Services
    【VSTO】Open XML
    【VSTO】资源、工具
    【VSTO】教学视频
    【VSTO】示例代码 
    【VSTO】Actions Pane
    【VSTO】智能标签 ...