Hi
I want to write a VB6 code that automatically converts word document into PDF format
Here's my code but it doesn't work
VB Code:
Private Sub Command1_Click() Dim cPDFCreator As clsPDFCreator Dim PDFName As String Dim PDFPath As String Set cPDFCreator = New clsPDFCreator Set cPDFCreatorOptions = New clsPDFCreatorOptions Set cPDFCreator.cOptions = cPDFCreatorOptions 'Am storing default printer to restore it later strDefaultPrinter = Printer.DeviceName If cPDFCreator.cStart("/NoProcessingAtStartup") = False Then MsgBox "Can't initialize PDFCreator.", vbCritical + _ vbOKOnly, "Error!" Exit Sub End If With cPDFCreator .cOption("UseAutosave") = 1 .cOption("UseAutosaveDirectory") = 1 .cOption("AutosaveDirectory") = "C:\PDFTEST\test" .cOption("AutosaveFilename") = "Description du service.pdf" .cOption("AutosaveFormat") = 0 ' 0 = PDF .cSaveOptions .cClearCache .cPrinterStop = False .cDefaultPrinter = "PDFCreator" .cPrintFile "C:\PDFTEST\Description du service.doc" End With Printer.Print Set cPDFCreator = Nothing Set cPDFCreatorOptions = Nothing End Sub
Can anyone help me
thanks




Reply With Quote