Azzera filtri
Azzera filtri

Manage powerpoint on Matlab

53 visualizzazioni (ultimi 30 giorni)
Ortinomax
Ortinomax il 15 Apr 2015
Commentato: Ashwini More il 3 Feb 2020
Hello,
Part of my job is now to create powerpoint with a lot of figure which "that is good ..." "that is not..". And all of the figure came from Matlab. I spent time to copy/paste one by one (and resizing since my Matlab figure are big). I searched how to automate this but I didn't find the keys.
Apparently, it involves the COM Auomation but I don't find documentation on it.
I found those things, which looked helpful but...
I tried to copy-past the saveppt code (my trash.m file), but I get an error (although the file exist) :
??? Invoke Error, Dispatch Exception: Le fichier spécifié est introuvable.
op = invoke(ppt.Presentations,'Open','validation_ppt.pptx',[],[],0);
in english : The specified file is missing.
I don't find any documentation on this. So I'm blocked.
If someone tells me : "Hey, here there is a pdf file on COM Automation server which explain how it works in Matlab." I would be happy.
(I don't really searched an answer on my present issue, since it will only be the first of the list. But how to get find documentation.)
EDIT : I linked the wrong file.
  2 Commenti
Ortinomax
Ortinomax il 16 Apr 2015
Thanks Sebastian Castro
One solution lead to another problem. So i'm stuck again. I tried to have my figure copied in the clipboard and then paste on the powerpoint.
ppt = actxserver('powerpoint.application');
myPres=ppt.Presentations.Open('D:\Perso\myppt.pptx');
slide3=myPres.Slides.Item(3); % slect the slide 3
myFIg=figure(); %create the figure to test
plot([0 1],[1 1],'m');
print('-dmeta',myFIg) % copy to clipboard
% past to the slide 3, and get the handles of the picture (useful to resize, move...)
pic(k)=slide3.Shapes.PasteSpecial().Item(1);
It works, and almost good. But when I do the same manually (Figure>Edit>Copy Figure then Powerpoint>Paste), the picture has transparency. It needs the transparency back.
I thought it could be done with optional argument of the PasteSpecial method. But I need to pass an PpPasteDataType argument, and everything I tried fail (Type Mismatch).
Any help would be appreciated.
Ashwini  More
Ashwini More il 3 Feb 2020
Hi,
I am working on adding images to existing powerpoint with matlab code. Your code helps me but instead of plotting figure in matlab, I have to add only .jpg figure.
So how can I change this code so that it will help me to copy specific image at specified location?
Any help would be appreciated!!

Accedi per commentare.

Risposta accettata

Sebastian Castro
Sebastian Castro il 15 Apr 2015

Più risposte (0)

Categorie

Scopri di più su MATLAB Report Generator in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by