Private Sub PrintPowerPointPresentation(strFilePath As String)
On Error Resume Next
Dim App As Object
Dim Presentation As Object
Dim nSlides As Long
Set App = CreateObject("PowerPoint.Application")
Err = 0
Set Presentation = App.Presentations.Open(strFilePath, 1, 1, 0)
If Err = 0 Then
nSlides = Presentation.Slides.Count
If nSlides > 0 Then
Presentation.PrintOptions.PrintInBackground = 0
Presentation.PrintOptions.ActivePrinter = _
"Universal Document Converter"
Call Presentation.PrintOut(0, nSlides, 0, 1, 0)
End If
Call Presentation.Close
Set Presentation = Nothing
End If
Call App.Quit
Set App = Nothing
End Sub
|