Main Content


Class: mlreportgen.ppt.Presentation
Namespace: mlreportgen.ppt

Search a presentation



searchResults = find(presentation,objectName) searches the specified presentation for the content or slide objects whose Name property value matches objectName.


expand all

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');
add(ppt,'Title Slide');
add(ppt,'Title and Content');

Find presentation objects whose Name property is Title.

contents = find(ppt,'Title')

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');

Close and view the presentation.


Here is the generated presentation:

Input Arguments

expand all

Presentation to search, specified as an mlreportgen.ppt.Presentation object.

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

expand all

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