c# 向word指定位置插入图片 急急!!!
这是我写的代码 但是只能在第一页 插入图片我想要的是 在任意一页任意位置都可以插入图片
Object Nothing = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Application oWord;
Microsoft.Office.Interop.Word.Document oDoc;
object name = "d:\\wordFile/myfile.doc";
object Range = System.Reflection.Missing.Value;
oWord = new Microsoft.Office.Interop.Word.ApplicationClass();
oWord.Visible = false;
//打开文档
oDoc = oWord.Documents.Open(ref name, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing, ref Nothing);
object a = true;
object b = true;
object left = null;
object top = null;
//定义位置
if (len == 1)
{
left = 80; top = 280;
}
if (len == 2)
{
left = 80; top = 480;
}
if (len == 3)
{
left = 80; top = 680;
}
if (len == 4)
{
left = 80; top = 880;
}
if (len == 5)
{
left = 80; top = 1080;
}
object width = 300;
object height = 150;
oDoc.Shapes.AddPicture(str, ref a, ref b, ref left, ref top, ref width, ref height, ref Nothing);
oDoc.Save();
oWord.Documents.Close(ref Nothing, ref Nothing, ref Nothing);
请大家 指教 谢谢!!!
补充:.NET技术 , C#