Can someone please let me know why this might occur?
I see a printjob go to my printer queue with only the Doc Name, Owner and Submitted fields filled in, but no PDF file is produced.
Earlier today it worked.
This is the code:
Code: Select all
Private Sub Command1_Click()
Dim tmpPrinter As Printer
With cdi
.DriverInit "CoastalPrinter"
' First time activation of printer
.EnablePrinter "Evaluation Version Developer Pro", "07EFCDAB010001001A62D63A7A374ADFC98E5C771E417CBCF622CE145AA431E6CCCF852963C57AE96ECB09167E3050FEC9FA4879FFEB40E4087C394B8B5FB0A19A8C3A1F5877ECDC2876FA965C7E3593F42639234E76372F9D0BCC451E3EC35A34CD77B5A61C16FEE831CFF46D3AEDE4CCCC58AEBAFF2A"
.CaptureEvents True
.DefaultDirectory = "C:\temp\sample\pdfs\"
.PaperSize = 3
.Orientation = 2
.Resolution = 300
.FileNameOptionsEx = &H1 + &H2 + &H20 + &H100000 ' NoPrompt + UseFileName + BroadcastMessages + Hyperlinks
.DefaultFileName = "test.pdf"
.SetDefaultConfig
End With
For Each tmprinter In Printers
If tmprinter.DeviceName = "CoastalPrinter" Then
Set Printer = tmprinter
Exit For
End If
Next tmprinter
Printer.Print
Printer.Print "HELLO WORLD"
Printer.EndDoc
End Sub