Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Is it possible to print the Bookmark in to the PDF using Macro.
Sub PrintReports
'Lets create a temporary bookmark, to store the current selection
ActiveDocument.CreateUserBookmark "PrintMakroStorage"
'Pls create a tablebox containing all reports and ID's to be printed out
Set ReportTable = ActiveDocument.GetSheetObject("TB15")
FOR RowIter = 1 TO ReportTable.GetRowCount - 1
reportID = (ReportTable.GetCell(RowIter,0).text)
reportHIRARCHY = (ReportTable.GetCell(RowIter,1).text)
reportGROUP = (ReportTable.GetCell(RowIter,2).text)
reportNAME = (ReportTable.GetCell(RowIter,3).text)
MyFilterField = (ReportTable.GetCell(RowIter,4).text)
MyFilterSelection = (ReportTable.GetCell(RowIter,5).text)
'Clear All
ActiveDocument.ClearAll
if MyFilterField <> "" THEN
ActiveDocument.Fields(MyFilterField).Select MyFilterSelection
end if
'call the print job
Print_PDF reportHIRARCHY, reportNAME, reportID, reportGROUP
'reset the start selections
ActiveDocument.RecallUserBookmark "PrintMakroStorage"
NEXT
ActiveDocument.RemoveUserBookmark "PrintMakroStorage"
End Sub
Sub Print_PDF(FieldValue, ReportName, ReportID, ReportGroup)
' Designed for early bind, set reference to Bullzip PDF Printer
Dim sPDFName
Dim sPDFPath
'/// Change the output file name here! ///
sPDFName = ReportName '& " - " & FieldValue
sPDFPath = "C:\Temp\" & FieldValue & "\2012 08 StandardReporting\" & ReportGroup & "\"
'For monthly publishing :: sPDFPath = "C:\Users\Administrator\Dropbox\" & FieldValue & "\2012 08 StandardReporting\" & ReportGroup & "\"
MyPrintPDFWithBullZip sPDFPath&sPDFName&".pdf"
'Wait until the print job has entered the print queue
ActiveDocument.GetApplication.Sleep 2000
' Print the QlikView Report
ActiveDocument.PrintReport ReportID, "Bullzip PDF Printer"
'Wait until PDF creator is finished then release the objects
ActiveDocument.GetApplication.Sleep 1000
End Sub
Is there a particular reason you're necro'ing old threads Vikas Mahajan?