VBA-SaveAs

E

Edward

Hi,
I have to open a PPT 2003 file in PowerPoint 2007 , but in part of my code I
want to saveAs the file as PPTX , which is the default format for 2007. I use
ActivePresentation.SaveAs "123", ppSaveAsDefault
I tried several other options for the file format , but it seems it's not
able to save as PPTX format. Am I missing something here?
 
D

David Marcovitz

Hi,
I have to open a PPT 2003 file in PowerPoint 2007 , but in part of my code I
want to saveAs the file as PPTX , which is the default format for 2007. I use
ActivePresentation.SaveAs "123", ppSaveAsDefault
I tried several other options for the file format , but it seems it's not
able to save as PPTX format. Am I missing something here?

Have you tried

ppSaveAsOpenXMLPresentationMacroEnabled

Or

ppSaveAsOpenXMLPresentation

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
D

David Marcovitz

Shyam,

After reading your response, I thought that I misread the post. I believe
the following is true:

(1) You can not use VBA in 2003 to save in the newer (.pptx) format.
(2) You can use VBA in 2007 to Save As a .ppt file in a .pptx format.
(3) The default refers to the default for the file so a Save As of a .ppt
file will, by default, save as a .ppt file.

Is this true?

--David

Ignore my reply. I misread the post.

Regards,
Shyam Pillai

Shyam Pillai said:
Edward,
The compatibility pack does not update the object model so you can't use
the new file formats programmatically.

Regards,
Shyam Pillai

Animation Carbon: http://www.animationcarbon.com

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 
S

Shyam Pillai

Hi David,
(1) You can not use VBA in 2003 to save in the newer (.pptx) format.
Yes. SaveAs does not recognize the new enum values. But there is a caveat,
see point 3.
(2) You can use VBA in 2007 to Save As a .ppt file in a .pptx format.
Yes, using the new enumerations available.
(3) The default refers to the default for the file so a Save As of a .ppt
file will, by default, save as a .ppt file.
Yes, if the file has never been saved it will default to the file format set
in the Options dialog. Because of this behavior, it is possible to perform
as SaveAs operation on a .pptx file even in PPT 2003 (with compatibility
pack) when ppSaveAsDefault is used.

Regards
Shyam Pillai

Image Importer Wizard: http://skp.mvps.org/iiw.htm
 
C

Chirag

The ppSaveAsDefault seems to be the following:
For non-macro presentation files:
1. PowerPoint 2007 saves in the file format specified by the file extension
provided to the SaveAs() method. If the file name extension is not a
presentation file, then it saves as a .pptx file.
2. PowerPoint 2003 always defaults to ppt.

For macro-enabled presentation files:
The default configured in PowerPoint 2007 (Office button, PowerPoint
Options, select "Save" on the left pane) has some effect:
1. If the default configured is .ppt file (97-2003 ppt), then all
presentations are saved as .ppt by default.
2. If the default configured is .pptx file (PowerPoint Presentation), then
all presentations are saved as a .ppt (since .pptx file does not support
macro-enabled presentations) file.
3. If the default configured is .pptm file (PowerPoint Macro-Enabled
Presentation), then all presentations are saved as a .pptm file.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 
D

David Marcovitz

Well, then, if I remember correctly, that explains the original poster's
problem. I believe he had a .ppt file opened in 2007. The .ppt file must
have contained macros (because he was trying to run the macros to do the
Save As). Using the default format would have worked if and only if he had
the default set to .pptm.
--David

The ppSaveAsDefault seems to be the following:
For non-macro presentation files:
1. PowerPoint 2007 saves in the file format specified by the file extension
provided to the SaveAs() method. If the file name extension is not a
presentation file, then it saves as a .pptx file.
2. PowerPoint 2003 always defaults to ppt.

For macro-enabled presentation files:
The default configured in PowerPoint 2007 (Office button, PowerPoint
Options, select "Save" on the left pane) has some effect:
1. If the default configured is .ppt file (97-2003 ppt), then all
presentations are saved as .ppt by default.
2. If the default configured is .pptx file (PowerPoint Presentation), then
all presentations are saved as a .ppt (since .pptx file does not support
macro-enabled presentations) file.
3. If the default configured is .pptm file (PowerPoint Macro-Enabled
Presentation), then all presentations are saved as a .pptm file.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

--
David M. Marcovitz
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
Microsoft PowerPoint MVP
Associate Professor, Loyola University Maryland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top