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:
  1. Private Sub Command1_Click()
  2. Dim cPDFCreator As clsPDFCreator
  3. Dim PDFName As String
  4. Dim PDFPath As String
  5.    
  6.    
  7. Set cPDFCreator = New clsPDFCreator
  8. Set cPDFCreatorOptions = New clsPDFCreatorOptions
  9. Set cPDFCreator.cOptions = cPDFCreatorOptions
  10. 'Am storing default printer to restore it later
  11. strDefaultPrinter = Printer.DeviceName
  12. If cPDFCreator.cStart("/NoProcessingAtStartup") = False Then
  13.         MsgBox "Can't initialize PDFCreator.", vbCritical + _
  14.                 vbOKOnly, "Error!"
  15.         Exit Sub
  16.     End If
  17.  
  18.  
  19. With cPDFCreator
  20. .cOption("UseAutosave") = 1
  21. .cOption("UseAutosaveDirectory") = 1
  22. .cOption("AutosaveDirectory") = "C:\PDFTEST\test"
  23. .cOption("AutosaveFilename") = "Description du service.pdf"
  24. .cOption("AutosaveFormat") = 0    ' 0 = PDF
  25. .cSaveOptions
  26. .cClearCache
  27. .cPrinterStop = False
  28. .cDefaultPrinter = "PDFCreator"
  29. .cPrintFile "C:\PDFTEST\Description du service.doc"
  30.  End With
  31. Printer.Print
  32.    
  33. Set cPDFCreator = Nothing
  34. Set cPDFCreatorOptions = Nothing
  35.    
  36. End Sub

Can anyone help me

thanks