How to hide an object from printing

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

Hi all,
I have a button on my master slide that runs a macro to
print the current slide. However, I'd like the printout
to not show the button. Is this possible?
Thanks!
- Dan
 
Since you are already using a macro to do your printing, you can just
modify your macro. Here's an example:

Sub printNoButton(theButton As Shape)
theButton.Visible = False
'You can replace the following two lines with your print lines
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=1, To:=1
theButton.Visible = True
End Sub

This will print the first slide without the button that was clicked to
print. The keys are the parameter for the procedure (theButton As
Shape), and the lines with theButton.Visible which hide the button and
then show it again. You can use whatever you were using before to print;
I just through in a couple of lines that will print the first slide, but
you already have lines of code that, I assume, work for printing what
want.

Let me know if you have any questions.

--David

--
David M. Marcovitz, Ph.D.
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
David,

Thanks very much -- the button is now hidden on the
printout, but somehow the code I'm using is confusing
the "current slide" setting to print.

When I click the button it exhibits very odd behavior --
sometimes printing the title page, sometimes printing the
previous slide, sometimes printing the slide two
previous. All I want it to do is print the current slide.

Any suggestions? (the code I'm using is below)
- Dan

Sub PrintSlide(theButton As Shape)
theButton.Visible = False
With ActivePresentation.PrintOptions
.RangeType = ppPrintCurrent
End With
ActivePresentation.PrintOut
theButton.Visible = True
End Sub
 
I'm not sure what is wrong with your routine. But you might try this
one. I think it will work for you:

Sub PrintSlide(theButton As Shape)
Dim curSlide As Long

theButton.Visible = False
curSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=curSlide, To:=curSlide
theButton.Visible = True
End Sub

--David

--
David M. Marcovitz, Ph.D.
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/
 
That did the trick! Thanks!
- Dan
-----Original Message-----
I'm not sure what is wrong with your routine. But you might try this
one. I think it will work for you:

Sub PrintSlide(theButton As Shape)
Dim curSlide As Long

theButton.Visible = False
curSlide = ActivePresentation.SlideShowWindow.View.Slide.SlideIndex
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=curSlide, To:=curSlide
theButton.Visible = True
End Sub

--David

--
David M. Marcovitz, Ph.D.
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/



.
 
Dan said:
I have a button on my master slide that runs a macro to
print the current slide. However, I'd like the printout
to not show the button. Is this possible?

Are you printing on a color or a b/w-printer? If b/w: Choose "View | Color
and grayscale" and switch to grayscale. Modify the settings so that the
button does not print at all. This is not possible for a color printer, you
will have to use a macro there.

Kind regards,
Ute
 
Back
Top