Hi,
I'm using following code to print access report:
Function InitToPDF() As Boolean
Set PDFCreator1 = CreateObject(Class:="PDFCreator.clsPDFCreator")
If PDFCreator1.cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can't initialize PDFCreator."
Exit Function
End If
With PDFCreator1
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With
InitToPDF = True
End Function
Function ToPDF(RepName As String, Izr As String, Direk As String, Fajl As String) As String
Dim c As Long
If DefaultPrinter = "" Then Stop
With PDFCreator1
.cOption("AutosaveDirectory") = Direk
.cOption("AutosaveFilename") = Fajl
.cPrinterStop = False
.cVisible = False
DoCmd.OpenReport RepName, acViewNormal, , Izr, acWindowNormal
End With
Do While (PDFCreator1.cOutputFilename = "")
DoEvents
c = c + 1
Sleep 200
If (c > (maxTime * 1000 / sleepTime)) Then Stop
Loop
Sleep 250
Do Until PDFCreator1.cCountOfPrintjobs = 0
DoEvents
Sleep 250
Loop
ToPDF = Direk & "\\" & Fajl & ".pdf"
End Function
It work fine, but I need option to hide printing status dialog. One that jump out during print and display:
Printing page1, page2... and just the "Cancel" button.
Or at least to disable Cancel button.