How do I keep an image (macro) from printing?

J

Jenn

I have created an Image using the Control Toolbox and have assigned it a
macro using the Action Settings - essentially it is a picture of a printer
and allows the viewer to click on the printer to print all slides - but I
don't want the image (/printer) to appear in the print out. How do I get
around this? Thanks!
 
J

John Wilson

In your vba add a ".visible = false" line to a reference to the printer
image Dont forget to add code to reset to true later!
--
 
D

David M. Marcovitz

I have done this with a regular shape, not a control toolbox shape, but
I'm sure it is also easy with the control toolbox shape. Here is code for
a regular shape:

Sub PrintWithoutButton (oShp As Shape)
oShp.Visible = False 'hide the button while printing
'Use the following three line or whatever you use to print
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=1, _
To:=ActivePresentation.Slides.Count
oShp.Visible = True 'show the button again after printing
End Sub

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
J

Jenn

Hi John,

Thanks for your post! Actually, I did do that, but perhaps it is written
incorrectly? This is what was in VBA (note PrintSlides is the macro)...

Private Sub Image1_Click()
Me.Shapes("Image1").Visible = msoFalse
PrintSlides
Me.Shapes("Image1").Visible = msoTrue
End Sub

Any thoughts?
Thanks!
Jenn
 
D

David M. Marcovitz

Interesting. I copied your code, and the only thing that didn't work for
me was th PrintSlides line, but I assume you have that procedure defined
elsewhere. I just changed PrintSlides to ActivePresentation.PrintOut, and
it worked perfectly with your hiding and showing code unchanged.
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
J

Jenn

Hi David,

Thanks for testing the code, did you try printing as well to see if the
image disappeared? I changed PrintSlides (which was the macro) to
ActivePresentation.PrintOut and it still prints the image. (Grrr! =) Did
you try creating the image through the Control Toolbox (just to ensure all
parameters are the same)? I wonder why this isn't working.

Thanks again for your help!
Regards,
Jenn
 
D

David M. Marcovitz

Yes, I actually printed, and it worked. I even commented out the line
that hides the picture to make sure it printed with the picture. I did
add the picture with the control toolbox (your code wouldn't work
otherwise). Perhaps your screen is not refreshing. Try commenting out the
line that shows the picture to see if it is still there (be sure you know
how to get the picture back if it does hide it). If it is a refresh
problem, the picture is likely to be there until you return to the slide.
You can try going to the slide before printing. That is, after hiding the
picture and before printing:

ActivePresentation.SlideShowWindow.View.GotoSlide _
ActivePresentation.SlideShowWindow.View.Slide.SlideIndex

This just goes to the current slide and sometimes works to refresh the
slide.

Also, does your slide have any animation or animated GIFs on it? I have
had problems with hiding and showing things when other kinds of animation
are present, particularly animated GIFs.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/
 
J

John Wilson

Your code worked fine for me too - no picture on the print
Private Sub Image1_Click()
Me.Shapes("Image1").Visible = msoFalse
ActivePresentation.PrintOut
Me.Shapes("Image1").Visible = msoTrue
End Sub


_____________________________
John Wilson
Microsoft Certified Office Specialist
 

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