Writing VBA code in Excel to Print Power point slides, and a PDF r

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Creating a print control file and printing reports from excel, power point
acrobat
was wondering if there was a way to priting the non excel reports using vba
written in excel
 
Tom

here is waht I came up with, but cannot get it to work
very new at this, and the excel 97 examples don't work either

Sub Macro1()
Dim pptApp As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Set pptApp = CreateObject("PowerPoint.Application")
Set pptPres = pptApp.Presentations.Open("P:\Test\DRAFT.ppt")

With pptPres.PrintOptions
.RangeType = ppPrintSlideRange
With .Ranges
.ClearAll
.Add Start:=3, End:=3
.Add Start:=8, End:=8
.Add Start:=11, End:=11
.Add Start:=14, End:=14
End With
.NumberOfCopies = 1
.Collate = msoTrue
.OutputType = ppPrintOutputSlides
.PrintHiddenSlides = msoTrue
.PrintColorType = ppPrintColor
.FitToPage = msoFalse
.FrameSlides = msoFalse
.ActivePrinter = "\\strnynt32\STHQPB_4003B2"
End With
Active
 
Made some progress
but it bombs out at 'OutputType = ppPrintOutputSlides'
line in the code, any understanding?

Sub Macro1()
Dim pptApp As Object
Dim pptPres As Object

Set pptApp = CreateObject("PowerPoint.Application")
pptApp.Visible = True
Set pptPres = _
pptApp.presentations.Open("P:\Financial Planning &
Analysis\Month-QTR Support\2006\08 - Aug\Development Data\DRAFT- REG Deal
Pipeline Data Book - August 2006.v1.ppt")

With pptPres.PrintOptions
.RangeType = ppPrintSlideRange
With .Ranges
.ClearAll
.Add Start:=3, End:=3
.Add Start:=8, End:=8
.Add Start:=11, End:=11
.Add Start:=14, End:=14
End With
.NumberOfCopies = 1
.Collate = msoTrue
.OutputType = ppPrintOutputSlides
.PrintHiddenSlides = msoTrue
.PrintColorType = ppPrintColor
.FitToPage = msoFalse
.FrameSlides = msoFalse
.ActivePrinter = "\\strnynt32\STHQPB_4003B2"
End With
ActivepptPres.PrintOut
End Sub
 
the constant ppPrintOutputSlides or any other constant in the powerpoint
object library will be undefined when using late binding such as you are
using. You will have to go into powerpoint and find what the value is and
use the value instead of the constant. Here are the values for the ones I
saw.

? ppPrintSlideRange
4
? ppPrintOutputSlides
1
? ppPrintColor
1
 
Back
Top