jweaks
jweaks

Reputation: 3792

Create new Powerpoint presentation based on selected slides in current presentation

I want the script to use the currently selected slides in the current presentation, and create a new presentation using those slides. This is what I'm trying, but can't get the syntax for copying the slides correct (the various commented lines).

tell application "Microsoft PowerPoint"
    activate
    set thisPresentation to active presentation
    --copy object slide 5 of active presentation -- of thisPresentation
    --set selectedSlides to slide range of selection of active window
    --copy slide range of selection of active window

    set newPresentation to make new presentation
    paste object newPresentation

    close newPresentation saving yes
end tell

Upvotes: 1

Views: 600

Answers (1)

jweaks
jweaks

Reputation: 3792

Blimey, was a dumb omission. The command is 'copy object', not just 'copy'.

tell application "Microsoft PowerPoint"
    activate
    copy object slide range of selection of active window

    set newPresentation to make new presentation
    paste object newPresentation
end tell

I knew it should work.

Upvotes: 3

Related Questions