filename = "2012-10-29 Call Option on CAR CS vs B"
buyerTSPath is the path of the file
WrdDoc is the active word document.
Kind regards
Julien
VBA:
[VBA]
Call GeneratePDF( fileName, buyerTSPath)
Sub GeneratePDF( ByVal sValue As String, ByVal sNewFolder As String)
p = ActivePrinter
WordApp.ActivePrinter = "PDFCreator"
With CreateObject("PDFCreator.clsPDFCreator")
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
.cOption("AutosaveDirectory") = sNewFolder
.cOption("AutosaveFilename") = sValue & ".pdf"
.cOption("AutosaveFormat") = 0
.cClearCache
wrdDoc.PrintOut
Do Until .cCountOfPrintjobs = 1
DoEvents
Loop
.cPrinterStop = False
Do Until .cCountOfPrintjobs = 0
DoEvents
Loop
.cClose
End With
ActivePrinter = p
End Sub
[/VBA]