We help IT Professionals succeed at work.

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

frankmorrison
on
1,244 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

Comment
Watch Question

CERTIFIED EXPERT
Top Expert 2010
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
I tried ppSaveAsPowerPoint3 and I'm getting the following error: "run-time error '-2147024809(80070057)': Presentation.SaveCopyAs: Invalid enumeration value.
CERTIFIED EXPERT
Top Expert 2010

Commented:
Are you doing this from inside or outside of PowerPoint?  If outside, then have you defined a constant or set a reference to PowerPoint?
John WilsonCEO PowerPoint Alchemy
CERTIFIED EXPERT

Commented:
Using LateBinding you cannot use PowerPoint Constants
Try:
.SaveAs "Old Format Copy",1
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.