Clear Filters
Clear Filters

Read notes from a PowerPoint presentation?

7 views (last 30 days)
Kapil Chauhan
Kapil Chauhan on 6 Dec 2021
Answered: Kautuk Raj on 2 Jun 2023
Hi,
Does anyone know if it is possible to read speaker notes for each slide in powerpoint from Matlab and collect them as a string/text? If so, how can one achieve it? I am trying to use the actxserver but am lost.
Thanks,
Kapil

Answers (1)

Kautuk Raj
Kautuk Raj on 2 Jun 2023
As pointed out by you, actxserver function has to be used to read speaker notes for each slide in PowerPoint from MATLAB and collect them as a string/text. You can use the following steps:
Create an ActiveX object for PowerPoint using the actxserver function in MATLAB.
ppt = actxserver('PowerPoint.Application');
Open the PowerPoint presentation using the ppt.Presentations.Open method.
presentation = ppt.Presentations.Open('path/to/presentation.pptx');
Make sure to replace 'path/to/presentation.pptx' with the actual path to your PowerPoint presentation.
Loop through each slide in the presentation and extract the speaker notes using the Slide.NotesPage.Shapes.Placeholders.Item property.
notes = cell(1, presentation.Slides.Count);
for i = 1:presentation.Slides.Count
notes{i} = presentation.Slides.Item(i).NotesPage.Shapes.Placeholders.Item(2).TextFrame.TextRange.Text;
end
Close the presentation and quit PowerPoint using the presentation.Close and ppt.Quit methods.
presentation.Close;
ppt.Quit;
Concatenate the speaker notes for all slides into a single string using the strjoin function.
allNotes = strjoin(notes);
This code creates a single string allNotes that concatenates the speaker notes for all slides in the presentation, using the strjoin function.

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!