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

Steve Rindsberg

Project Org said:
I am having exactly the same problem. I have tried comparing our two macros
to see if it will give a clue as to what is going on but no luck. Maybe you can
spot something.
I am wanting the last slide to print to use as a "certificate" to give the
student. It will work on my computer but when I move to another computer the
printers are different so it won't print. Is there "language" for a default
printer? I know nothing about macros I used the record macro feature in PP 2000
xp.

Delete the .ActivePrinters line and it'll print to the default printer on
whatever system it runs on.
Sub Printcurrent Page()
with Active Presentation.Print Options
..RangeType = ppPrintCurrent
..Number of copies=1
..Collate=msoTrue
..OutputType=PrintOutputSlides
..PrintHiddenSlides=msoTrue
..PrintColorType=ppPrintBlackand White
..Fitto Page = msoFalse
..FrameSlides=msoFalse
..Active Printers="//OMHW5_Tree/Training.Print_Objects.OMH"
End With
ActivePresentation.Print Out
EndSub

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 

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