VBS to create Powerpoint 2007, cannot change SlideSize ?

Y

YB Lee

I have a visual basic script (test.vbs) to create a powerpoint and to draw
some shapes on it.

I set the size of ppt to A3 using powerpoint automation, but when I open the
generated ppt file, the SlideSize is not applied.

In Powerpoint 2003, the script works perfectly. But in Powerpoint 2007
SlideSize attribute was not changed.

Is there any more step to script?
How can I specify or change SlideSize attribute with automation?

--------------------------------------------------------
How to generate problem :
Save attached script to test.vbs and execute it.
You can find new file c:\test.ppt. Open it and inspect Design/.../Slide size.


Const ppLayoutBlank = 12
Const ppSlideSizeA4Paper = 3
Const ppSlideSizeA3Paper = 9
Const msoOrientationVertical = 2

Sub pptSave()
Dim ppApp
Dim ppPres
Dim ppCurrentSlide
Dim tShape


Set ppApp = CreateObject("PowerPoint.Application")
Set ppPres = ppApp.Presentations.Add(false)
ppPres.PageSetup.SlideSize = ppSlideSizeA3Paper
ppPres.PageSetup.SlideOrientation = msoOrientationVertical
Set ppCurrentSlide = ppPres.Slides.Add(1, ppLayoutBlank)

ppPres.SaveAs "C:\test.ppt"
ppPres.Close

End Sub

Call pptSave()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top