Solved

PowerPoint VB Automation: Save 2007 (pptx) to 2003 (ppt) format

Posted on 2009-06-26
4
1,180 Views
Last Modified: 2012-05-07
Experts, I am automating the conversion of several powerpoint files from PowerPoint 2007 .pptx to 2003 format .ppt.  But I'm having problems with the "SaveAs" or "SaveCopyAs" command. Please help! My code is below:
Dim oPPT As Object
    Dim spath
    Dim opptdoc
    
    Set oPPT = CreateObject("PowerPoint.Application")
    spath = App.Path & "\test.pptx"
    sOutput = App.Path & "\slides\"
    
    Set opptdoc = oPPT.Presentations.Open(spath, , , False)
    With opptdoc
      .SaveCopyAs App.Path & "\New Format Copy.ppt" '<=== this does not convert it to 2003 format
      .SaveAs "Old Format Copy", ppSaveAsPowerPoint2 <=== I get an enumaration error
    End With     
    opptdoc.Close
    Set opptdoc = Nothing
    oPPT.Quit
    End

Open in new window

0
Comment
Question by:frankmorrison
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 24728771
Hi, frankmorrison.

There is no ppSaveAsPowerPoint2 format.  The choices are ppSaveAsPowerPoint7, ppSaveAsPowerPoint4, and ppSaveAsPowerPoint3.  I think you want the latter.
0
 
LVL 1

Author Comment

by:frankmorrison
ID: 24734050
I tried ppSaveAsPowerPoint3 and I'm getting the following error: "run-time error '-2147024809(80070057)': Presentation.SaveCopyAs: Invalid enumeration value.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 24734530
Are you doing this from inside or outside of PowerPoint?  If outside, then have you defined a constant or set a reference to PowerPoint?
0
 
LVL 23

Expert Comment

by:JSRWilson
ID: 25034501
Using LateBinding you cannot use PowerPoint Constants
Try:
.SaveAs "Old Format Copy",1
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question