Hi Ken
I tried your code, but it does not seem to work for me.
It does loop indefinitely.
Also the pdfcreator pop-up window, keeps on showing (blocking the automation of the process).
I am trying to do Word conversion to pdf (and cannot upgrade my office to a newer version than 2003, because I am at work).
Any help would be amazing.
thanks a lot
Julien
I tried your code, but it does not seem to work for me.
It does loop indefinitely.
Also the pdfcreator pop-up window, keeps on showing (blocking the automation of the process).
I am trying to do Word conversion to pdf (and cannot upgrade my office to a newer version than 2003, because I am at work).
Any help would be amazing.
thanks a lot
Julien
Code:
Sub GeneratePDF(ByVal sDocumentToConvert As String, ByVal sValue As String, ByVal sNewFolder As String)
Dim pdfjob As PDFCreator.clsPDFCreator
Dim p
p = ActivePrinter
WordApp.ActivePrinter = "PDFCreator"
Set pdfjob = CreateObject("PDFCreator.clsPDFCreator")
With pdfjob
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sNewFolder
.cOption("AutosaveFilename") = sValue
.cOption("AutosaveFormat") = 0 ' 0 = PDF
.cClearCache
End With
'Print the document to PDF
wrdDoc.PrintOut copies:=1
' Wait until the print job has entered the print queue
Do Until pdfjob.cCountOfPrintjobs = 1
DoEvents
Loop
pdfjob.cPrinterStop = False
' Wait until PDF creator is finished then release the objects
Do Until pdfjob.cCountOfPrintjobs = 0
DoEvents
Loop
pdfjob.cClose
Set pdfjob = Nothing
ActivePrinter = p
End Sub