How to specify slide order when generating plots and exporting to new powerpoint presentation?
2 views (last 30 days)
Show older comments
My code creates a ppt presentation that it populates with figures created from data pulled from excel. The total slide count is ~250 with two figures per slide, but the slide order is reversed from how it is needed. How can I reverse the order or specify slide order when generating and populating slides within a newly created powerpoint presentation? Applicable code below:
h = actxserver('PowerPoint.Application');
h.Visible = 1;
h.Presentation.invoke;
Presentation = h.Presentation.Add;
---GENERATE DATA & FIGURES--- within this part of the code and within a for loop I have the following for generating and populating slides:
filename = strcat(folder,'_',num2str(thou)); %name new figure file
cfilename = strcat('Test0_',num2str(thou),'.jpg'); %create file name for each control iteration to compare with current iteration visually
saveas(fig,fullfile(fname,filename),'jpg'); %save new figure file as jpg
jfilename = strcat(filename,'.jpg'); %create full file name for saved image to be used in ppt import
close(fig) %close figure
Presentation.Slides.invoke;
blankSlide = Presentation.SlideMaster.CustomLayouts.Item(1);
Slide = Presentation.Slides.AddSlide(1,blankSlide);
Image1 = Slide.Shapes.AddPicture(fullfile(fname,cfilename),'msoFalse','msoTrue',75,75,400,400);
Image2 = Slide.Shapes.AddPicture(fullfile(fname,jfilename),'msoFalse','msoTrue',475,75,400,400);
Thanks
0 Comments
Answers (0)
See Also
Categories
Find more on MATLAB Report Generator in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!