Print Macro

J

Jon

Hi,

I have the following print macro in a PP2000 file that
should print direct to anyones' default printer but for
some reason doesn't. Can anyone spot why please.

Sub PrintCurrentSlide()

' Get current slide number in the running show.
Dim SldNo As Long
Dim Pres As Presentation
SldNo = SlideShowWindows(1).View.Slide.SlideIndex
Set Pres = SlideShowWindows(1).Presentation
With Pres.PrintOptions
' Set the shaperange type to slides
.RangeType = ppPrintSlideRange
.NumberOfCopies = 1
.Collate = msoTrue
.OutputType = ppPrintOutputSlides
.PrintHiddenSlides = msoTrue
.PrintColorType = ppPrintBlackAndWhite
.FitToPage = msoFalse
.FrameSlides = msoFalse
' Clear existing ranges
.Ranges.ClearAll
' Set the print range to current slide
.Ranges.Add SldNo, SldNo
End With
Pres.PrintOut
Set Pres = Nothing
End Sub
 
D

David M. Marcovitz

It looks like your code specifies a specific printer. You might want to
look at Example 7-9 on my web site (click Examples by Chapter and Chapter
7):

http://www.loyola.edu/education/PowerfulPowerPoint/

It uses the following code to print slide 6 (change the nubmers in the
3rd line from 6 to something else to print a different slide).


Sub PrintResults()
ActivePresentation.PrintOptions.OutputType = ppPrintOutputSlides
ActivePresentation.PrintOut From:=6, To:=6
End Sub

This generally works with any printer.

--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/
 

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