Article ID: 169995
Article Last Modified on 10/11/2006
Sub ShellPrint()
Dim strPath As String
Dim strShellStatment As String
Dim dRetVal As Double
' Get the path to Powerpnt.exe.
strPath = PowerPoint.Application.Path
' Start building the first Shell function argument.
strShellStatment = strPath & "\Powerpnt.exe /p "
' Use this to print a single presentation called C:\Test.ppt.
strShellStatment = strShellStatment & "C:\Test.ppt"
' Use the following syntax to print more than one presentation.
' strShellStatment = strShellStatment & "C:\Test.ppt C:\Test2.ppt"
' Execute the Shell function.
dRetVal = Shell(strShellStatment, 1)
' If the Shell function call fails, 0 is returned.
If dRetVal = 0 Then
' The Shell function failed. Enter error-trapping code here.
MsgBox "The Shell command failed!", vbCritical
End If
End Sub
163435 VBA: Programming Resources for Visual Basic for Applications
Additional query words: ppt97 8.0 vba statement option
Keywords: kbcode kbdtacode kbhowto kbmacro kbprogramming KB169995