PDf creator enregistrer sous nouveau fichier
Bonjour,
J'utilise un script VBS afin de sauvegarder un rapport PDF depuis qlikview. Le code fonctionne nickel !!
Le seul soucis c'est que ça écrase les anciennes valeurs à chaque fois que j'exporte mon rapport. Or je souhaite que cela génére à chaque fois un nouveau fichier PDF avec en nom la date du jour par exemple. Et la je bloque.
le code sauvegarde PDF:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub Print
PrintPDF "","RP04"
End Sub
'
Function PrintPDF(NamePDF, qvObject)
Dim vPath
' vPath= "A modifier "
Set PDFCreator = CreateObject("PDFCreator.clsPDFCreator")
PDFCreator.cStart ("/NoProcessingAtStartup")
PDFCreator.cOption("UseAutosave") = 1 ' J'ai essayé avec 0 mais cela ouvre la sauvegarde à la main.
PDFCreator.cOption("UseAutosaveDirectory") = 1 ' Use a specific save directory
'Comment this line if you already set on PDFCreator a directory where you wont to save a PDFfile
PDFCreator.cOption("AutosaveDirectory") =vPath ' Set autosave directory from variable 'ActiveDocument.getVariable("TempPath").GetContent.String ' Set autosave directory from set analisis variable
PDFCreator.cOption("AutosaveFormat") = 0 ' 0=PDF, 1=PNG, 2=JPG, 3=BMP, 4=PCX, 5=TIFF, 6=PS, 7= EPS, 8=ASCII
PDFCreator.cOption("AutosaveFilename") = NamePDF ' & ".pdf"' set the filename, optionally you can get the Caption of the object and use it as Filename
PDFCreator.cPrinterStop = False 'printer enabled
ActiveDocument.PrintDocReport qvObject, "PDFCreator" 'print
ActiveDocument.GetApplication.Sleep 10000 'stop my macro for 5 sec, its time is need to save a PDF
PDFCreator.cClearCache() 'clear cache
PDFCreator.cClose()
end function |
Si vous avez une idée,
Merci d'avance.