Slide Layouts changes through Applescript in PPT 2008

M

matzh

Hello,

I am trying to create a Powerpoint presentations with all slide titles
preset from a text file, or the like, so that each line of the text file.
Pasting into the outlline view on the left hand side in Powerpoint is not
working. It just puts me everything onto the first title.
So I tried Applescript which I think is more elegant anyway.

My code:
ell application "Microsoft PowerPoint"
open alias "Macintosh HD:Users:xyz:Documents:Test.pptx"
set myDocument to make new slide at after slide 3 of the active
presentation with properties {slide layout text slide}
#set properties of slide 4 of active presentation to slide layout text slide
end tell

No matter what slide layout I am using, it is just inserting a title slide.
This also happens when I am opening a new presentation with Applescript.
If I uncomment the third command above, I get an error: Microsoft PowerPoint
got an error: Can’t set properties of slide 4 of active presentation to slide
layout text slide.

If I use "set properties of myDocument" instead, it is ignored and remains a
title slide.

Am I overseeing something or is this so buggy? Is there any alternative
solution? Changing/inserting text also only gave me error messages so far :(
Has anyone successfully done something with Applescript and Powerpoint 2008,
yet? I have found very few resources about this in the net...
 
S

Steve Rindsberg

If it's a plain ascii text file that looks something like this:

Title for slide 1
Title for slide 2
... and so on

you can just open it into PPT. Try it manually first. File, Open, point to the
text file and go.




Hello,

I am trying to create a Powerpoint presentations with all slide titles
preset from a text file, or the like, so that each line of the text file.
Pasting into the outlline view on the left hand side in Powerpoint is not
working. It just puts me everything onto the first title.
So I tried Applescript which I think is more elegant anyway.

My code:
ell application "Microsoft PowerPoint"
open alias "Macintosh HD:Users:xyz:Documents:Test.pptx"
set myDocument to make new slide at after slide 3 of the active
presentation with properties {slide layout text slide}
#set properties of slide 4 of active presentation to slide layout text slide
end tell

No matter what slide layout I am using, it is just inserting a title slide.
This also happens when I am opening a new presentation with Applescript.
If I uncomment the third command above, I get an error: Microsoft PowerPoint
got an error: Can’t set properties of slide 4 of active presentation to slide
layout text slide.

If I use "set properties of myDocument" instead, it is ignored and remains a
title slide.

Am I overseeing something or is this so buggy? Is there any alternative
solution? Changing/inserting text also only gave me error messages so far :(
Has anyone successfully done something with Applescript and Powerpoint 2008,
yet? I have found very few resources about this in the net...

================================================
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

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