Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to print,save and close pdf writer

I know there has been many posts about this,but no matter what I try I still end up with the save as dialog with the added action of overwriting the file. How do I write the macro to overwrite the file, and then close the pdf?

This is the macro I currently have:

sub  printreport


ActiveDocument.PrintReport"RP01"  

reportFile = "C:\report"&".pdf"
printReportPDF(reportFile)


End sub

Function printReportPDF(pdfOutputFile)

Set WSHShell = CreateObject("WScript.Shell")
temp3 = WSHShell.Run("cmd /K del c:\Hedge.pdf /q & exit")

temp3 = WSHShell.Run("cmd /K ren c:\QVOutput.pdf Hedge.pdf & exit")
set WSHShell = Nothing


End function

I run on QW 10 SR1 and on IE 8

Thanks

0 Replies