Consulting

Results 1 to 7 of 7

Thread: Solved: Code under clipart?

  1. #1
    VBAX Regular
    Joined
    Sep 2009
    Posts
    36
    Location

    Solved: Code under clipart?

    1. Can you put VBA code under a basic shape/clipart? I want to make a print button print, I have this code for printing:

    [vba]ActivePresentation.PrintOptions.RangeType = ppPrintCurrent
    ActivePresentation.PrintOut[/vba]
    2. Not sure whether or not that is the best code for printing out the current slide. So furthermore, a better print code would be appreciated.

    3. One more thing to add, which is slightly off topic. I have a presentation which gives the user option buttons and a command button to move onto the next slide, but the problem is they can continue the presentation without selecting an option, which i don't want. So is there a code which disables them moving onto the next slide if they haven't selected an option?
    Last edited by jamieCR9; 11-14-2009 at 10:36 AM.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,095
    Location
    Yes you can trigger code with pretty well any shape

    http://www.pptalchemy.co.uk/vba.html should help

    However that is not good code. ppPrintCurrent prints the current slide in EDIT view. Not necessarily the same as the current show slide.

    Try this:
    [vba]Sub print_curr()
    Dim Icurr As Integer
    Icurr = SlideShowWindows(1).View.CurrentShowPosition
    With ActivePresentation.PrintOptions
    .Ranges.ClearAll
    .OutputType = ppPrintOutputSlides
    .RangeType = ppPrintSlideRange
    .Ranges.Add Icurr, Icurr 'from current to current
    End With
    ActivePresentation.PrintOut
    End Sub[/vba]

    Slide Show>Set up Show>Viewed at a Kiosk will prevent user moving on without your buttons
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Sep 2009
    Posts
    36
    Location
    Can't see what I am looking for in the link? And I take it that code is for the actual clip art image, because I tested it under a command button and that didn't work. Thanks John.

    Tried inserting it through a module, whatever that means lol, and it gives me a message saying the integer (slideshowwindows(1)) is out of range. I am useless I know.

    It is a kiosk already, but I need them to select their option, but they can just press the command button and then move onto the next slide without any choice being made.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,095
    Location
    The code is to work in show view when you click the clip art It will error in edit view

    To get into module press Alt f11
    In this view Insert > Module

    Paste the code into the module
    Return to PowerPoint and select the clip art

    In 2007 Insert > Action
    In 2003 Slide show > Action settings

    In both select Run Macro as the action

    Play the show and click on the clip art.
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  5. #5
    VBAX Regular
    Joined
    Sep 2009
    Posts
    36
    Location
    Wow that is genius, thanks a bunch.

  6. #6
    VBAX Regular
    Joined
    Sep 2009
    Posts
    36
    Location
    *****

  7. #7
    nice solution

Posting Permissions

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