How to find open presentations and objects on slides with activeX

6 views (last 30 days)
Hi,
Question 1: In this case I have multiple presentations opened via windows explorer. By creating an activeX server I can find out how many ppt's are open. but I can't manage to retrieve the individual names of these presentations, in order to connect to them. This is how far I got:
This displays the amount of open presentations:
get(My_server.Presentations,'Count')
This displays the name of the active presentation, but I am still missing the inactive ones:
get(My_server.Presentations.Application,'Caption')
Question 2: How do I connect to one of the the individual elements on a slide, when no handles are present. I can find the amount of elements on a slide by typing:
get(My_Page.Shapes.PlaceHolders)
And this is how to get the Title, but I am still missing a connection to a subtitle, textfields, pictures, etc...
get(My_Page.Shapes.Title.Textframe.TextRange.Text)
Thanks!

Accepted Answer

Guillaume
Guillaume on 5 Dec 2014
MSDN is the best source for information on the object model of Office applications. The documentation is a lot better than Matlab's.
To get the name of a presentation, use the Name property of a Presentation object. To get all the presentation objects, use the Item property of the Presentations collection.
application = actxserver('PowerPoint.Application');
fprintf('\n');
for count = 1 : application.Presentations.count
presentation = application.Presentations.Item(count);
fprintf('Item %d is "%s"\n', count, presentation.Name);
end
fprintf('\nActive presentation is: %s\n\n', application.ActivePresentation.Name);

More Answers (0)

Community Treasure Hunt

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

Start Hunting!