フィルターのクリア

PowerPoint API handling PPT sections

8 ビュー (過去 30 日間)
Andreas
Andreas 2023 年 2 月 10 日
コメント済み: Andreas 2023 年 2 月 21 日
But came to a different conclusion.
Upon inserting a new slide at index 2, that slide becomes the header of section 2, instead of a content slide for section1.
How can I insert slides into specific sections on a powerpoint? Currently, the slide just replace the last header of section2 when inserted into section1.
Dummy1.pptx
NewTest.pptx
CODE
%-------------------------------------------------------------------------
% Without below code would have: "mlreportgen.ppt.Presentation"
import mlreportgen.ppt.*;
% %-------------------------------------------------------------------------
%-------------------------------------------------------------------------
% Create Histogrm
x = randn(10000,1);
h = histogram(x);
saveas(gcf,'myPlot_img.png');
plot1 = Picture('myPlot_img.png');
%-------------------------------------------------------------------------
%-------------------------------------------------------------------------
% to open again and then add a slide
ppt = Presentation('NewTest.pptx','Dummy1.pptx');
open(ppt);
x =1;
newSlide = outputPPT(ppt,x,plot1);
close(ppt);
rptview(ppt);
function Return = outputPPT(ppt,x,plot1)
import mlreportgen.ppt.*;
newSlide = add(ppt,'Picture with Caption',x+1);
replace(newSlide,'Title 1','Histogram of Vector');
replace(newSlide,'Picture Placeholder 2',plot1);
newSlide = add(ppt,'Picture with Caption',x+3);
Return = newSlide;
end
END

回答 (1 件)

HimeshNayak
HimeshNayak 2023 年 2 月 17 日
Hi Andreas,
As per my understanding, you want to add slides to a specific section using “mlreportgen.ppt.*”. Currently the API does not support the functionality. The responsible teams are already working on the feature.
Regards,
HimeshNayak
  1 件のコメント
Andreas
Andreas 2023 年 2 月 21 日
Thank you HimeshNayak,
Was that always the case? Rahul posted that mlreportgen.ppt.* cannot create sections but it can add slides to sections that already exist. See here: How to add sections to PowerPoint with MATLAB Report Generator - MATLAB Answers - MATLAB Central (mathworks.com)

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

カテゴリ

Help Center および File ExchangeUpdate PowerPoint Presentation Content についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by