主要内容

取代

类:mlreportgen.ppt.PicturePlaceholder
包:mlreportgen.ppt

用图片代替图片占位符

描述

例子

replacementPictureObj=取代(picturePlaceholder,图片)替换指定的图片占位符指定的图片和返回的图片对象。

例子

全部展开

添加一个标题和图片幻灯片演示,然后将标题和图片占位符替换为您自己的标题和图片。

导入PPT包,所以你不需要使用长,PPT API类的完全限定名称。

进口mlreportgen.ppt。*

创建一个报告。

ppt =表示(“myPicturePlaceholderPresentation.pptx”);打开(ppt);

添加一个幻灯片标题和图片布局。

幻灯片=添加(ppt,“标题和图片”);

使用找到幻灯片对象的方法找到的占位符对象的名字标题

titlePlaceholderObj =找到(幻灯片,“标题”)
titlePlaceholderObj = TextBoxPlaceholder属性:大胆:[]字体:[]ComplexScriptFont: [] FontColor:[]字形大小:[]斜体:[]罢工:[]下标:[]上标:[]强调:[]写成BackgroundColor: [] VAlign:[]的名字:“标题”X: [] Y:[]宽度:[]高度:[]风格:[]孩子:父母[]:[1×1 mlreportgen.ppt。幻灯片)标签:“ppt。TextBoxPlaceholder: 6:9”Id:“完”

找到方法返回一个mlreportgen.ppt.TextBoxPlaceholder对象。

替换占位符文本内容的标题。

替换(titlePlaceholderObj“飞机”);

使用找到幻灯片对象的方法找到的占位符对象的名字图片

picturePlaceholderObj =找到(幻灯片,“图片”)
picturePlaceholderObj = PicturePlaceholder属性:大胆:[]字体:[]ComplexScriptFont: [] FontColor:[]字形大小:[]斜体:[]罢工:[]下标:[]上标:[]强调:[]写成BackgroundColor: [] VAlign:[]的名字:“照片”X: [] Y:[]宽度:[]高度:[]风格:[]孩子:父母[]:[1×1 mlreportgen.ppt。幻灯片)标签:“ppt。图片Placeholder:7:10' Id: '7:10'

找到方法返回一个mlreportgen.ppt.PicturePlaceholder对象。

将图片占位符替换为一幅画。

替换(picturePlaceholderObj、图片(“b747.jpg”));

关闭和视图表示

关闭(ppt);rptview (ppt);

输入参数

全部展开

图片占位符,指定为一个mlreportgen.ppt.PicturePlaceholder对象。

图片作为替代图片占位符,指定为一个mlreportgen.ppt.Picture对象。

输出参数

全部展开

更换图片,作为一个返回mlreportgen.ppt.Picture对象。

版本历史

介绍了R2015b