find
Class: mlreportgen.ppt.Slide
Namespace: mlreportgen.ppt
Search slide for content
Description
searches a slide for a slide content object whose searchResults
= find(slide
,objectName
)Name
property
value matches objectName
.
Examples
Search a Slide for Content
Find a content object in an mlreportgen.ppt.Slide
object by using the find
method.
Import the PPT namespace so that you do not have to use long, fully qualified names for the PPT API classes.
import mlreportgen.ppt.*
Create a presentation.
ppt = Presentation('mySlideFindPresentation.pptx');
open(ppt);
Add a slide with a Title and Content
layout.
slide = add(ppt,'Title and Content');
Search the slide for a content object that has the Name
property value '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
returns a 1-by-1 array that contains an mlreportgen.ppt.ContentPlaceholder
object. Specify that the text in the placeholder object is bold and add text to the object.
contents(1).Bold = true;
add(contents(1),'This is bold text');
Close and view the presentation.
close(ppt); rptview(ppt);
Here is the generated presentation:
Input Arguments
slide
— Slide to search
mlreportgen.ppt.Slide
object
Slide to search, specified as an mlreportgen.ppt.Slide
object.
objectName
— Name property value to search for
character vector | string scalar
Name
property value to search for, specified as a
character vector or string scalar.
When you add a slide to a presentation, the add
method
sets the Name
property of the content objects in the
slide based on the slide layout. See getLayoutNames
. The
Name
property values include:
'Title'
'Content'
'Table'
'Picture'
'Text'
'Vertical Text'
The Name
property can also be set to a custom
value.
Output Arguments
searchResults
— Search results
array of content objects
Search results, returned as an array of content objects such as:
Version History
Introduced in R2015b
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)