Copy & Paste of PowerPoint Slides in Matlab

7 ビュー (過去 30 日間)
Oliver
Oliver 2011 年 6 月 17 日
コメント済み: Himanshu Verma 2022 年 11 月 7 日
Hi there,
I have a PowerPoint template presentation consisting of one slide to which I would like to append several slides with Matlab figures. Hence, for each figure I want to copy and paste this slide and add the figure to the pasted one. Up to now I use an activexserver to open the presentation. I know how to select a slide and how to copy a figure to it, but I don't know how to copy and paste the slide itself.
Can anyone help me? And where can I find documentation for the possible activeX-commands for PowerPoint in Matlab? Searching with Google gives a lot of other ActiveX stuff, probably I used the wrong search items...
Thanks a lot it advance!

採用された回答

Kaustubha Govind
Kaustubha Govind 2011 年 6 月 17 日
I don't know of specific documentation examples for calling PowerPoint as a COM server from MATLAB (there are examples with Excel however), but there is at least one File Exchange submission that might be useful: saveppt
Also, here is the official PowerPoint COM API Reference. Once you are familiar with this API, using it in MATLAB is no different from using it in VBA.
  1 件のコメント
Oliver
Oliver 2011 年 6 月 20 日
I already know the saveppt-example, but the link to the reference is very helpful! Thanks a lot :-)

サインインしてコメントする。

その他の回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2011 年 6 月 17 日
I think you are looking for the methods for doing "Duplicate Slide" or copy and paste slides. The following should do it.
hApp=actxserver ('Powerpoint.Application');
set(hApp,'Visible','msoTrue');
hPre=hApp.Presentations.Add;
hSli=hPre.Slides;
hPag1=hSli.Add(1,1);
hSha=hPag1.Shapes;
set(hSha.Item(1).TextFrame.TextRange,'Text','This is my title');
hPag2=hPag1.Duplicate;
hPag1.Copy
hPag3=hSli.Paste;
hPag4=hSli.Paste;
  2 件のコメント
Oliver
Oliver 2011 年 6 月 20 日
Thank you very much! This is exactly what I was looking for :-)
Himanshu Verma
Himanshu Verma 2022 年 11 月 7 日
@Fangjun Jiang I'm working on a Matlab code to copy the powerpoint slides and paste them as images in an excel sheet using actxserver. But I'm unable to use 'Copy' command. Can you help me with it? Thanks in advance.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeUse COM Objects in MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by