All pastes #282797 Raw Edit

Something

public text v1 · immutable
#282797 ·published 2006-12-17 21:38 UTC
rendered paste body
Function printPDF(path As Variant, ACPath As String)
    Dim myRetVal As Integer
    
    ' Launch the Acrobat Reader based on Registry Key
    myRetVal = Shell(ACPath, vbHide)
    
    'If Debug is on Display this stages Debug Messages
    If chkDebug.Value = vbChecked Then
        displayDbg = MsgBox("Sending FilePrintSilent(" & path & ")", vbInformation, "DEBUG MSG")
    End If
    
    'Only actually print the PDF's if the checkbox is unchecked. Otherwise we dont want to be printing.
    If chkDebug.Value = vbUnchecked Then
    
        'Send the FilePrintSilent command to Acrobat Reader
        Text1.LinkMode = 0
        Text1.LinkTopic = "acroview|Control"
        Text1.LinkMode = 2
        Text1.LinkTimeout = 32767
        Text1.LinkExecute "[FilePrintSilent(" & Chr(34) & path & Chr(34) & ")]"
    Else
        'do nothing
    End If
    
    'If Debug is on Display this stages Debug Messages
    If chkDebug.Value = vbChecked Then
        displayDbg = MsgBox("FilePrintSilent Completed.", vbInformation, "DEBUG MSG")
        displayDbg = MsgBox("Sending AppExit Command", vbInformation, "DEBUG MSG")
    End If
    
    'Send AppExit Command to Acrobat Reader
    Text1.LinkMode = 0
    Text1.LinkTopic = "acroview|Control"
    Text1.LinkMode = 2
    Text1.LinkTimeout = 32767
    Text1.LinkExecute "[AppExit]"
    
    'If Debug is on Display this stages Debug Messages
    If chkDebug.Value = vbChecked Then
        displayDbg = MsgBox("AppExit Command Completed.", vbInformation, "DEBUG MSG")
        displayDbg = MsgBox("Start of Pause for " & txtDelay.Text & "ms", vbInformation, "DEBUG MSG")
    End If
    
    'Sleep the program for the specified amount of time
    Sleep (txtDelay.Text)
    
    'If Debug is on Display this stages Debug Messages
    If chkDebug.Value = vbChecked Then
        displayDbg = MsgBox("End of Pause for " & txtDelay.Text & "ms", vbInformation, "DEBUG MSG")
    End If
End Function