[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 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