Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro -PDF- Sheets

Can i print all sheets in a single pdf file through a macro vbscript?

ex: only one sheets

sub Export
set docprop = ActiveDocument.GetProperties
set ps = docprop.PrintSheetSettings
ps.SheetPrintDrawBackGround = true
ActiveDocument.SetProperties docprop

tempFolder="C:xxxx\Desktop\"
reportName="TestDashboard"
reportFile = tempFolder & reportName & day(date) & monthname(month(date))&".pdf"
'msgbox reportFile
printReportPDF reportFile
ActiveDocument.GetApplication.Sleep 5000
ActiveDocument.sheets("Filtri").print
ActiveDocument.GetApplication.Sleep 5000
msgbox "saved."
end sub
'===========================================================================
Function printReportPDF(pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikviewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikviewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End function

0 Replies