PowerPoint VBA from LC?

Peter Reid preid at reidit.co.uk
Sun Aug 7 07:35:20 EDT 2016


I have 100+ old PowerPoint PPT files that can't be opened by modern PowerPoint (2007 and later).  However I have managed to get a copy of PowerPoint 2003 that can open these old PPTs and save them as new PPTs that can be opened by newer PowerPoint.  My problem is the 100+ files that need converting!

So, I thought I'd write an LC stack that will take a folder of PPTs and feed them into PowerPoint 2003, one at a time, to save them into a new folder in the newer PPT format.  I can do the file/folder stuff OK in LC and I intend to use the "Do script as VBscript" or shell(script) to activate PowerPoint and get it to open & save a file at a time.

My problem is the VBA script needed to open PowerPoint, open a file & then save the file.  I've found some code on the LC forums:

put "set objExcel = GetObject(," & quote & "Excel.Application" & quote & ")" & return into TheScript
put "objExcel.Application.Run " & quote & "D_Scostamenti.xls!ImportAMC" & quote & ", " & quote & tPath & quote after TheScript
   Do TheScript as "VBScript"

but I can't see how to save the file and leave PowerPoint active ready for the next file in the sequence. Can anyone help me with this please?

Thanks.

Peter
--
Peter Reid
Loughborough, UK




More information about the use-livecode mailing list