Results 1 to 13 of 13
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Make a new ppt from larger ppt (ppt xp, w2000)

    I have a large ppt, large.ppt. It has 100 slides. I want to define several sections in the slides, like section1 = slides 1-5, section 2 = slides 6-14, section 3=slides 15-17...

    Then after the sections are all picked i want to delete the "other" slides that aren't picked and save them the "picked" ones as a different filename.

    For instance, if they choose section 1 and section 3, they will get slides 1-5 and slides 15-17 in a new ppt. The new.ppt will have 8 slides in it. I am putting the code in the large.ppt. Can anyone please help me with a start to vba code. thanks much

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    As a starting point, it seems you have a couple of approaches for building the new presentation: additive or subtractive (i.e. create a new empty presentation and add the necessary slides into it, or make a copy of the existing presentation and then delete from it only those slides that are not wanted in the new presentation).

    A starting point for the latter would be something like:

    Public Sub TestCreateNewSubPres()
    Dim OrigPres As Presentation
    Dim NewPres As Presentation

    Set OrigPres = ActivePresentation
    OrigPres.Slides.Range.Copy
    Set NewPres = Presentations.Add
    NewPres.Slides.Paste
    NewPres.Slides.Range(Array(20, 19, 18)).Delete
    'etc. deleting additional slides as necessary

    Set OrigPres = Nothing
    Set NewPres = Nothing
    End Sub

    (deleting from the last toward the first to avoid index errors)
    There's probably a more efficient way to do the above, such as NewPres.SaveAs, but I'm sticking to a simple method as I don't really know PPT!

    What's likely to be the two tricky issues though:

    What interface do you provide the user to make the selection? - hard to see how you avoid creating a userform here.

    How flexible do the section/ slide ranges definitiions need to be? - i.e. you can create a userform with checkboxes for sections 1 through 5, and put code behind the userform defining section 1 as a range from slides 1-5 etc., but if you ever want to redefine the sections, you'd need to change the slide numbers in the code as well.

    A start, anyway.

    Gary

  3. #3
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    Why use VBA? It's very ugly! Can't you just use slide sorter view, lasso or shift-click the slides you want and copy them to a new presentation? --Sam
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    <<VBA .... ugly>>?? <img src=/S/evilgrin.gif border=0 alt=evilgrin width=15 height=15>

    But seriously, suppose you have a presentation with 100 slides divided into 20 sections. Copying from the slide sorter view, clicking in the new presentation, pasting, clicking back to the original presentation, copying the next range of slides etc, repeat up to 20 times - that's a lot more work than unchecking some check boxes on a userform and clicking OK, no?

    (Besides, I never do PPT VBA, and it's fun!) <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Gary

  5. #5
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    <img src=/w3timages/blackline.gif width=33% height=2>
    that's a lot more work than unchecking
    <img src=/w3timages/blackline.gif width=33% height=2>
    I don't think so, unless you simplified presentations for a living. By the time you created a decent user-interface, you could have done 1000's of slides in sorter view.

    <img src=/w3timages/blackline.gif width=33% height=2>
    > VBA .... ugly
    <img src=/w3timages/blackline.gif width=33% height=2>
    Excel object model <img src=/S/love.gif border=0 alt=love width=15 height=15>
    Word object model <img src=/S/puke.gif border=0 alt=puke width=60 height=15>
    PoPo object model <IMG SRC=http://www.mtl.com/sam/images/computer.gif>
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  6. #6
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    Gee, take away a guy's fun!.. <img src=/S/surrender.gif border=0 alt=surrender width=31 height=23>
    Love those illustrations. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    But one last try - this scenario:

    Our friend, in the sales department's central office, has created a 100-slide PowerPoint sales presentation, which is to be used by a couple of dozen sales reps when visiting clients. For each client, the sales rep wants to tailor the presentation, and eliminate those slides which are not relevant to that client or that pitch.

    Each sales rep visits say five clients a day. That's something like 800 presentation-editing exercises done by the sales reps, each week, week after week. By having a userform, you're saving the sales reps an aggregate amount of time that might be significant - less time sorting slides, more time with the clients.

    n that scenario (which I have no idea resembles the current case), the time invested in building and maintaining the userform would be worth it, I think.
    No go? - still too ugly? (it resembles a lot of what I do for a living...) <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>

    Gary

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    hmmm thanks for all the input. It is exactly like Gary's scenario. I need it VERY simple, my users will not be able to cut out the slides they don't want etc. from the slide sorter. They need a simple user form to come up that gives them only the "sections" they ask for.

    I'm creating a "wizard" user form that asks them what "sections" they want and when they click on OK they get those slides in a new ppt. Gary, thanks for the code. How or where do I define the sections? How do i way that slides 1-5 will be "section1" and add those when they click on OK? thanks for your help

    I'm also thinking of 2 listboxes and moving from 1 to the other to "build" the new presentation. That way they can move up and move down their selections in the rightside listbox to order them in the way they want. Any, vba help is greatly appreciated.

  8. #8
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    Gary, you're exactly correct, this is a perfect example of a need for a userform. It's simple, fast, and you can add checks to make sure they always include required slides. Still ugly to develop! --Sam <img src=/S/drop.gif border=0 alt=drop width=23 height=23>
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  9. #9
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    <P ID="edit" class=small>Edited by Gary Frieder on 04-Feb-02 21:35.</P>Fortunately(??), I'm home sick tonight, or wouldn't have had time to do this.
    But it was a fun project - most of the work was with the userform which is applicable to other apps too.

    So jha, here is working example of what you've described - you should be able to connect the dots and tailor it for your presentation.
    There is one little bit of flaky behavior with the userform button to move items up in the list - it doesn't seem to want to behave.

    Open the attached ppt., save it to your local machine, then open it in PPT. You should see a toolbar called "Create New Presentation".

    NOTE: Jefferson Scher has come to the rescue and suggested I attach a zipped version of the ppt file - great idea - hope this works.

    Gary
    Attached Files Attached Files

  10. #10
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    this is soooooo totally cool! i can't thank you enough.

    the move up and down works for me

  11. #11
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    hi, it's me again. Everything is working well. I'm able to add different master templates to the "newpres". After the user selects the sections they want and selects the template design they like, i need to add a client logo to their presentation. I want to add it to the master page so it appears in the bottom righthand corner of every slide.

    I have the user put the client's logo file in c:logos and then i have them enter the name of it into a textbox in my app's form, txtClientLogo.text. How do I get to the slide master of the template that is chosen and insert the logo in a specific position? I've tried to do it using the macro reader but I can't seem to program it for any file that is entered in the txtClientLogo.text box and located in c:logos.

    Can you give me some guidance. Thank you

  12. #12
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    Hi jha,

    You're exposing my ignorance of PPT - beyond having written a couple of macros. Not knowing the steps one would take - in the user interface - to select the template, and set up a slide master in a template, it's hard to know what steps to take to do this via code.
    A little poking around though produced code like this - don't know if it is relevant to this situation:

    ActivePresentation.SlideMaster.Shapes.AddPicture

    - have a look at the VBA Help for the AddPicture method - you need to provide it with a filename (and path). There are also arguments for Top and Left which may let you control the location which the logo will get placed on the slide.

    If this doesn't fill the bill, then post back with a description of the steps required - in the user interface - to set up the master slide in a template - that might provide guidance on what needs to be done via code.

    Hope this helps,
    Gary

  13. #13
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Make a new ppt from larger ppt (ppt xp, w2000)

    It's exactly like Gary says. Record a macro to insert the logo and move it where you want it. Then add the IncrementLeft and IncrementTop to the Left and Top so that it goes in the right location and delete all but the AddPicture statement. Same thing works for the TitleMaster if you need it. Below is an example. HTH --Sam
    <pre>Sub Macro1()
    ActivePresentation.SlideMaster.Shapes.AddPicture _
    FileName:="C:Your PathYour File.jpg", _
    LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, _
    Left:=550, Top:=350, Width:=99, Height:=99
    End Sub</pre>

    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •