필터 지우기
필터 지우기

activex PowerPoint Application Saving as ".ppt" default, not ".pptx" ?

조회 수: 4 (최근 30일)
Kevin
Kevin 2012년 1월 4일
I am trying to write a powerpoint using activex and in doing so specify the name of the file I would like to save as something like 'MySlides.pptx'.
I have 2010 office loaded on my PC, but for some reason it is saving the new file as 'MySlides.pptx.ppt' which is defaulting to 2007 format of '.ppt'. How can I specify what format of slides I would like to open and save the presentation as? Thanks
%HERE IS HOW I CALL THE CODE, SIMPLIFIED
filespec = 'MySlides.pptx';
ppt = actxserver('PowerPoint.Application');
op = invoke(ppt.Presentations,'Open',filespec,[],[],0);
%THEN MODIFY SLIDES...
%NOW SAVE
invoke(op,'SaveAs',filespec,1);

채택된 답변

Fangjun Jiang
Fangjun Jiang 2012년 1월 4일
try invoke(op,'SaveAs',filespec,11); 11 is ppSaveAsDefault. Go to PowerPoint help, Visual Basic Reference, Enumerations, PpSaveAsFileType to see all the enumeration values.
  댓글 수: 2
Kevin
Kevin 2012년 1월 4일
Excellent. Worked like a charm, thank you.
Fangjun Jiang
Fangjun Jiang 2012년 1월 4일
If that is the case, maybe invoke(op,'SaveAs',filespec) is sufficient.

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

추가 답변 (1개)

Tony
Tony 2013년 5월 17일
You may effectively work with powerpoint files with to repair ppt file

카테고리

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