ITPub博客

首页 > > > VSTO 对于PPT的操作问题

VSTO 对于PPT的操作问题

作者:chinarocky 时间:2019-10-16 10:42:18 0 删除 编辑

对于PPT的操作,在标题上添加了文本和图片,怎么让文本置于顶层,不然图片会被覆盖住!

PowerPoint.Presentation presentation = this.Application.Presentations.Add();

PowerPoint.CustomLayout customLayout =

presentation.SlideMaster.CustomLayouts[PowerPoint.PpSlideLayout.ppLayoutTitle];

PowerPoint.Slide slide = presentation.Slides.AddSlide(1, customLayout);

string filePath = "C:\\图片1.jpg";

PowerPoint.Shape pic;

pic = slide.Shapes.AddPicture(filePath, Office.MsoTriState.msoFalse, Office.MsoTriState.msoTrue

, slide.Shapes[1].Left, slide.Shapes[1].Top, slide.Shapes[1].Width, slide.Shapes[1].Height);

pic.Height = slide.Shapes[1].Height;

pic.Width = slide.Shapes[1].Width;

slide.Shapes.Title.TextFrame.TextRange.Text = "123456";

slide.Shapes.Title.TextFrame.TextRange.Font.Color.RGB = Color.Red.ToArgb();

slide.Shapes.Title.TextFrame.TextRange.Font.Size = 52;

slide.Shapes[2].Delete();

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4547/viewspace-3159890/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: python初级问题
请登录后发表评论 登录
全部评论

注册时间:2019-07-10

  • 博文量
    213
  • 访问量
    1691