《添加引用》——>《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里,应该怎样?
还有可以控制文字写到文本框吗?????
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里,应该怎样?
还有可以控制文字写到文本框吗?????
2、doc1.InlineShapes.Add(ref filePath, ref missing,...............)
3、delete磁盘图片文件目前我知道的就这种方法
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】智能标签 ...