Applescript to convert pptx file to ppt in Powerpoint 2016

I am trying to run the script (pasted below) to convert a powerpoint pptx file to ppt file using Office 2016. But it throws a lot of security warnings and finally the ppt that saves is missing some of the pptx specific content. It was working fine in earlier version of Office. If I manually open the file in powerpoint and then try to save it in ppt format, then also it throws the warning, but finally the ppt gets saved and also has the pptx content.


How can I fix this issue ? Does anyone have another script to convert pptx file to ppt in Office 2016 ?


Thanks,

-Nitin

on runargv

--we require exactly 3 arguments

--pptAppPath, src pptx, dest ppt

set ret to "0"

if not length of argv = 3 then set ret to "kError_IncorrectNumberOfArgs"


if ret = "0" then

set pptPath to item 1 of argv

set src to item 2 of argv

set dest to item 3 of argv


try

tell applicationpptPath

using terms from application "Microsoft PowerPoint"


launch


set pres to "1"

set presFound to false

set presCount to count of presentations


repeat with i from 1 to presCount

set curPres to presentationi

set curPresName to full name of curPres as string


if curPresName = src then

set pres to curPres

set presFound to true


endif

end repeat


if presFound then

try


--save active presentation in dest as «constant PPff


savepresindestas «constant PPff

on error errmesgnumbererrn


set ret to "kError_CouldNotSaveToDestinationPresentation"

end try


--close pres

else

set ret to "kError_CouldNotOpenSourcePresentation"

end if

end using terms from

end tell

on error


set ret to "kError_CouldNotOpenPowerpointApplication"

end try

end if


return ret

end run

iMac, OS X El Capitan (10.11.1)

Posted on Dec 7, 2015 2:23 AM

Reply
4 replies

Dec 8, 2015 11:31 PM in response to rccharles

I am trying to convert a ‘.pptx’ file to ‘.ppt’ file using Office 16 on MAC OS 10.11.1

When I convert the same file from the ‘.pptx’ format to the ‘.ppt’ format manually, i.e., without using applescript, the file is converted and it has all the content. While I do this task manually, I get a window which says:

‘Your presentation contains a chart with data that’s outside the column and row limit in earlier versions of Excel. This data won’t be included in the chart,’

But after clicking the ‘SaveAnyway’ button, the ‘.pptx’ file converts to ‘.ppt’ file without any issues.

On the contrary, when I use the applescript, I do not get any such popup and the file converts to ‘.ppt’ format with the chart not being displayed in the output file as expected.

The applescript works fine for all the versions of Office prior to Office 16.


Thanks in advance.


PS: The popup dialog mentioned above looks like this. [Screenshot attached]User uploaded file

Dec 9, 2015 2:45 PM in response to nit.goyal

Hi,


nit.goyal wrote:


I am trying to convert a ‘.pptx’ file to ‘.ppt’ file using Office 16 on MAC OS 10.11.1

When I convert the same file from the ‘.pptx’ format to the ‘.ppt’ format manually, i.e., without using applescript, the file is converted and it has all the content. While I do this task manually, I get a window which says:

‘Your presentation contains a chart with data that’s outside the column and row limit in earlier versions of Excel. This data won’t be included in the chart,’

But after clicking the ‘SaveAnyway’ button, the ‘.pptx’ file converts to ‘.ppt’ file without any issues.



I use the latest version of Powerpoint (Version 15.16):

When I convert a presentation manually with some chart, I get the same popup dialog as you.


But, when I use this script, Powerpoint displays nothing and the presentation is converted and saved without issue.


set dest to "/Users/MyName/Desktop/Presentation11.ppt" as POSIX file as text
tell application "Microsoft PowerPoint"
    save active presentation in dest as save as presentation --  PowerPoint (97-2003) format
end tell

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Applescript to convert pptx file to ppt in Powerpoint 2016

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.