?
Solved

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

Posted on 2009-06-26
4
Medium Priority
?
1,183 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 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

741 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