Solved

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

Posted on 2009-06-26
4
1,160 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
  • 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now