PDA

View Full Version : Solved: Code under clipart?



jamieCR9
11-14-2009, 09:14 AM
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:

ActivePresentation.PrintOptions.RangeType = ppPrintCurrent
ActivePresentation.PrintOut
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?

John Wilson
11-15-2009, 08:38 AM
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:
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

Slide Show>Set up Show>Viewed at a Kiosk will prevent user moving on without your buttons

jamieCR9
11-15-2009, 08:47 AM
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.

John Wilson
11-15-2009, 09:03 AM
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.

jamieCR9
11-15-2009, 09:27 AM
Wow that is genius, thanks a bunch. :)

jamieCR9
11-27-2009, 08:49 AM
*****

blaqk
01-19-2010, 09:22 PM
nice solution