필터 지우기
필터 지우기

Manage powerpoint on Matlab

조회 수: 53 (최근 30일)
Ortinomax
Ortinomax 2015년 4월 15일
댓글: Ashwini More 2020년 2월 3일
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
Ortinomax
Ortinomax 2015년 4월 16일
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 2020년 2월 3일
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!!

댓글을 달려면 로그인하십시오.

채택된 답변

Sebastian Castro
Sebastian Castro 2015년 4월 15일
  댓글 수: 1
Ortinomax
Ortinomax 2015년 4월 16일
I missed it. Thanks

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by