Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi,
i use following macro to print a report and save a file as:
sub printRP04
reportFile = "c:" & "" & reportID & "_" & fieldID & "_" & reportName & ".pdf"
printReportPDF reportFile
ActiveDocument.PrintReport "RP12", "QlikViewPDF"
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
now reportID, fieldID and reportName i want to replace against 3 actual selected fields so the file gets the right name to save......this is my first macro so i dont now how to get the fieldvalues into the macro......do i have to care about integer and string? because one of the fields will be an string? can anyone help me with the code and syntax?
regards
Try this:
SET reportID = ActiveDocument.Fields("reportID").GetPossibleValues
If reportID.Count>0 Then
reportFile = "c:" & "\" & reportID.Item(0).Text
End IF
Hi, corleone.
Try this:
set mySelections= ActiveDocument.Fields("Field1").GetSelectedValues
for i=0 to mySelections.Count-1
set currentValue = mySelections.Item(i).text
next
thx Mark 4 help........worked for me!