wylaok

 

 

Word.Range range111;

//页边距设置
range111.PageSetup.TopMargin = wdApp.CentimetersToPoints(float.Parse("0"));//上页边距
range111.PageSetup.BottomMargin = wdApp.CentimetersToPoints(float.Parse("0"));//下页边距
range111.PageSetup.LeftMargin = wdApp.CentimetersToPoints(float.Parse("0"));//左页边距
range111.PageSetup.RightMargin = wdApp.CentimetersToPoints(float.Parse("0"));//右页边距

//插入图片
object linkToFile = false;
object saveWithDocument = true;
object rangeInsert;
// imexWord.GoToUpCell();
rangeInsert = range111;

Word.InlineShape shape = wdDoc.InlineShapes.AddPicture(fullName, ref linkToFile, ref saveWithDocument, ref rangeInsert);

//设置图片格式

shape.Width = 600f;
shape.Height = 825f;
Word.Shape pic = shape.ConvertToShape();
pic.WrapFormat.Type = Word.WdWrapType.wdWrapFront;//文字上方

 

//插入文件,fullName为文档完整路径
object objFalse = false;
object miss = System.Reflection.Missing.Value;
object confirmConversion = false;
object link = false;
object attachment = false;
wdApp.Selection.InsertFile(fullName, ref miss, ref confirmConversion, ref link, ref attachment);

分类:

技术点:

相关文章:

  • 2021-12-15
  • 2021-12-05
  • 2021-12-05
  • 2021-12-05
  • 2021-12-03
  • 2021-11-24
  • 2021-11-07
  • 2021-10-13
猜你喜欢
  • 2021-12-03
  • 2021-09-29
  • 2022-01-02
  • 2021-09-29
  • 2021-12-15
相关资源
相似解决方案