Powerpoint(PPT) 2003和2007添加http开头的图片的问题解决

2019-04-15 13:20发布

powerpoint 2003 直接 “AddPicture (http://” 可行,如:
  1. string pic = "http://bianbian.org/example.gif";
  2. _Slide.Shapes.AddPicture(pic, MsoTriState.msoFalse, MsoTriState.msoTrue,
  3.     0, 0, _Pres.PageSetup.SlideWidth, _Pres.PageSetup.SlideHeight);
但在ppt 2007中,无法通过AddPicture添加http开头的图片,必须先AddShape,然后Fill:
  1. PPT.Shape shape = _Slide.Shapes.AddShape(MsoAutoShapeType.msoShapeRectangle,
  2.     0, 0, _Pres.PageSetup.SlideWidth, _Pres.PageSetup.SlideHeight);
  3. shape.Fill.UserPicture(pic);
详见:http://support.microsoft.com/kb/928983/en-us