• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1192
  • Last Modified:

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

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     
    Set opptdoc = Nothing

Open in new window

  • 2
1 Solution
David LeeCommented:
Hi, frankmorrison.

There is no ppSaveAsPowerPoint2 format.  The choices are ppSaveAsPowerPoint7, ppSaveAsPowerPoint4, and ppSaveAsPowerPoint3.  I think you want the latter.
frankmorrisonAuthor Commented:
I tried ppSaveAsPowerPoint3 and I'm getting the following error: "run-time error '-2147024809(80070057)': Presentation.SaveCopyAs: Invalid enumeration value.
David LeeCommented:
Are you doing this from inside or outside of PowerPoint?  If outside, then have you defined a constant or set a reference to PowerPoint?
Using LateBinding you cannot use PowerPoint Constants
.SaveAs "Old Format Copy",1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now