|
这个就要用到AddPicture的函数 了。当然也不能使用我拉直接的字符串导入的方法了。那也是不行的,要使用组件的方式才可以。
[code=csharp]object oMissing = System.Reflection.Missing.Value;
object oEndOfDoc = "\\endofdoc"; /* \endofdoc is a predefined bookmark */
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); [/code] |
|