Page 1 of 1

Scripting Powerpoint

Posted: Mon Oct 21, 2013 3:54 pm
by froodster
I'm trying to script powerpoint with a vbscript written in the script editor. My specific problem is in using:

ActivePresentation.ExportAsFixedFormat

(I can saveas pdf but this doesn't give me the functionality I need) Has anyone else had any luck with this?

Scripting Powerpoint

Posted: Mon Oct 28, 2013 8:37 am
by freddyp
I stumbled over the same problem some time ago and even when trying it outside Switch with a VBS file that is run using cscript, it gives the error message:

Microsoft VBScript runtime error: Object doesn't support this property or method: 'objPPT.ActivePresentation.ExportAsFixedFormat'



It must be a bug in the PowerPoint VBA environment. There are several posts about problems with the ExportAsFixedFormat method in PowerPoint on the internet. Most of the answers suggest to use the SaveAs method, but that does not have as many options as ExportAsFixedFormat.



However, when you use the method in a macro inside PowerPoint it works, so the problem is really located in the scripting host environment.



There are two theoretical workarounds, but I have not tried them.



First, the PrintOut method works and has all the options of ExportAsFixedFormat, so that may be a workaround, but then you have to be able to print to a virtual printer that will save as PDF and that will not pop up a printer dialog.



Second, if you could run a macro on a file that has been opened (possibly using the Auto_Open event) you could then run the ExportAsFixedFormat method inside PowerPoint and that would work. Again, theoretically.



Freddy

Scripting Powerpoint

Posted: Mon Nov 04, 2013 4:30 pm
by froodster
Hi,

My workround in the end was to create a small wrapper function and install it as a PowerPoint Add-in. I then called this function from vbscript and all is well.