find
Class: mlreportgen.ppt.Presentation
Namespace: mlreportgen.ppt
Search a presentation
Description
searches the specified presentation for the content or slide objects whose
searchResults
= find(presentation
,objectName
)Name
property value matches
objectName
.
Examples
Find Content in Presentation
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. Add two slides that have titles.
ppt = Presentation('myPresentation.pptx'); open(ppt); add(ppt,'Title Slide'); add(ppt,'Title and Content');
Find presentation objects whose Name
property is Title
.
contents = find(ppt,'Title')
contents=1×2 object
1×2 TextBoxPlaceholder array with properties:
Bold
Font
ComplexScriptFont
FontColor
FontSize
Italic
Strike
Subscript
Superscript
Underline
BackgroundColor
VAlign
Name
X
Y
Width
Height
Style
Children
Parent
Tag
Id
The find
method returns a 1-by-2 array of mlreportgen.ppt.TextBoxPlaceholder
objects. The first object is for the title in the first slide and the second object is for the title in the second slide.
Replace the title in the first slide with My Presentation Title
.
p = Paragraph('My Presentation Title');
replace(contents(1),p);
Close and view the presentation.
close(ppt); rptview(ppt);
Here is the generated presentation:
Input Arguments
presentation
— Presentation to search
mlreportgen.ppt.Presentation
object
Presentation to search, specified as an mlreportgen.ppt.Presentation
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 on 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 or slide objects
Search results, returned as an array of content or slide objects. The array can contain content objects, such as:
The array can also contain mlreportgen.ppt.Slide
objects.
Version History
Introduced in R2015b
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi 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)