Hi All:
I am trying to convert a HTML document into pdf using the PDFCreator, however, it never creates the document silently like it does with a word document. I receive the Print dialogue box prompt which only converts the html document when i press the Print button. I would like to convert the html document without receiving the Print dialogue. Any help would be greatly appreciated. List below is the code I am currently using...
Dim cConverter As clsPDFCreator
Dim cConverterOptions As clsPDFCreatorOptions
Dim DefaultPrinter As String
Set cConverter = New clsPDFCreator
Set cConverterOptions = New clsPDFCreatorOptions
Set cConverter.cOptions = cConverterOptions
If cConverter.cStart("/NoProcessingAtStartup") = False Then
MsgBox "Can not Initialise PDF Converter", vbCritical, "PDF Conversion Error"
Exit Function
End If
With cConverter
DefaultPrinter = .cDefaultPrinter
.cOption("PDFDisallowCopy") = 1
.cOption("PDFDisallowModifyContents") = 1
.cOption("PDFDisallowModifyAnnotations") = 1
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sPath
.cOption("AutosaveFilename") = sFNme
.cOption("AutosaveFormat") = 0
.cDefaultPrinter = "PDFCreator"
.cClearCache
.cPrintFile (sName) <-- when the code gets to this line it opens the Print Dialogue - I would like it to convert the file here without the Print dialogue prompt
.cPrinterStop = False
End With
Sleep 1000
With cConverter
.cPrinterStop = True
.cDefaultPrinter = DefaultPrinter
Sleep 200
.cClose
End With
Sleep 2000 ' Wait until PDFCreator is removed from memory
Set cConverterOptions = Nothing
Set cConverter = Nothing