how to comunicate between Matlab And power point or Matlab and acrobat reader

Alex picture Alex · Jun 15, 2011 · Viewed 7.8k times · Source

I want to send a variable from Matlab to PowerPoint or AcrobatReader, then depend on the value of this variable, PowerPoint goes to next or previous slide or exit, or zoom in or zoom out in acrobatreader. is it possible? it should be because nowadays we can control these kind of software with remote control it means they can get data from outside, but how is or what is the protocol? tanx.

Answer

Lambdageek picture Lambdageek · Jun 15, 2011

You can drive PowerPoint via ActiveX

h = actxserver('PowerPoint.Application');
h.Visible = 1; % make the window show up
h.Presentations.Open('C:\Temp\MyPresentation.pptx');
%%
h.ActivePresentation.SlideShowSettings.Run;  % there is now a slide show running
%%
hShow = h.SlideShowWindows.Item(1);
%%
hShow.View.GotoSlide(3);  % go to the 3rd slide
hShow.View.Next;   % go to next slide
%%
hShow.View.Exit;   % end slide show
%%
h.ActivePresentation.Close;   % close the presentation
%%
h.Quit;
delete(h);

You should check out the MATLAB documentation for actxserver, and also the MSDN Power Point developer Reference. Most of the methods and properties of an ActiveX object show up in MATLAB as methods and properties. You can use methods(h) and get(h) to examine them. The only tricky ones are collections. You will generally need to say something like hCollection.Item(N) to get the N-th item from the collection.