find
类: mlreportgen.ppt.Slide
命名空间: mlreportgen.ppt
在幻灯片中搜索内容
说明
在幻灯片中搜索 searchResults = find(slide,objectName)Name 属性值与 objectName 匹配的幻灯片内容对象。
示例
使用 mlreportgen.ppt.Slide 方法在 find 对象中查找内容对象。
导入 PPT 命名空间,这样您就不必对 PPT API 类使用长而完全限定的名称。
import mlreportgen.ppt.*创建演示文稿。
ppt = Presentation('mySlideFindPresentation.pptx');
open(ppt);添加具有 Title and Content 布局的幻灯片。
slide = add(ppt,'Title and Content');在幻灯片中搜索具有 Name 属性值 'Content' 的内容对象。
contents = find(slide,'Content')contents =
ContentPlaceholder with properties:
Bold: []
Font: []
ComplexScriptFont: []
FontColor: []
FontSize: []
Italic: []
Strike: []
Subscript: []
Superscript: []
Underline: []
BackgroundColor: []
VAlign: []
Name: 'Content'
X: []
Y: []
Width: []
Height: []
Style: []
Children: []
Parent: [1×1 mlreportgen.ppt.Slide]
Tag: 'ppt.ContentPlaceholder:198:244'
Id: '198:244'
find 返回一个包含 mlreportgen.ppt.ContentPlaceholder 对象的 1×1 数
组。指定占位符对象中的文本为粗体,并将文本添加到该对象。
contents(1).Bold = true;
add(contents(1),'This is bold text');关闭并查看演示文稿。
close(ppt); rptview(ppt);
以下是生成的演示文稿:

输入参数
要搜索的幻灯片,指定为 mlreportgen.ppt.Slide 对象。
要搜索的 Name 属性值,指定为字符向量或字符串标量。
当您向演示文稿添加幻灯片时,add 方法会根据幻灯片布局设置幻灯片中内容对象的 Name 属性。请参阅 getLayoutNames。Name 属性值包括:
"Title""Content""Table""Picture""Text""Vertical Text"
Name 属性也可以设置为自定义值。
输出参量
版本历史记录
在 R2015b 中推出
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)