oWord.Selection.InlineShapes.AddPicture(ref name,ref LinkToFile,ref   SaveWithDocument,ref Range); 在插入图片时候我想控制图片大小,比例

解决方案 »

  1.   

    up,请问楼主如何向word插入图片啊?
      

  2.   

    回覆:楼上两位
    object oMissing = System.Reflection.Missing.Value;
    object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined book */ 
    object name= "d:\\myfile.doc";
    object Range=System.Reflection.Missing.Value;

    //Start Word and create a new document.
    Word.Application oWord;
    Word.Document oDoc;
    oWord = new Word.ApplicationClass();
    oWord.Visible = true;
    oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,ref oMissing, ref oMissing);
    oWord.Selection.Font.Bold = 1;
    oWord.Selection.Font.Size=18;
    oWord.Selection.ParagraphFormat.Alignment =Word.WdParagraphAlignment.wdAlignParagraphCenter;
    oWord.Selection.InlineShapes.AddPicture("e:/wzxsjs/picture/xczp/2005/02/K330206980000200501000201.jpg",ref oMissing,ref oMissing,ref Range);
      

  3.   

    这个简单了,先把图片读到程序中,然后缩小,再存到硬盘上,再读到Word中