Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 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…
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…

910 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

24 Experts available now in Live!

Get 1:1 Help Now