Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
what's wrong in that code...
it shows type mismatch error....
in
Type mismatch: 'deleteReport'
Type mismatch: 'printReportPDF'
Type mismatch: 'redimarrReports'
code is..
sub sendReport
tempFolder = "c:"
Set oReports = ActiveDocument.Fields("reportID").GetPossibleValues
Dim arrReports()
if oReports.Count > 0 then
redimarrReports(oReports.Count)
for i = 0 to oReports.Count -1
reportID = oReports.Item(i).Text
set rep = ActiveDocument.GetReport(reportID)
reportName = rep.Name
reportFile = tempFolder&reportID& "_" &reportName& ".pdf"
'deleteReport (reportFile) 'Cleaning out any previous report
'arrReports(i) = reportFile
'Print report to PDF
msgbox(reportFile)
printReportPDF reportID, reportFile
' Check the file is printed, before trying to send it
checkOutputFile(reportFile)
next
end if
end sub
can you attach some application so that we can Test it
One possibility is that the variable reportName (that holds the Report Name) has spaces (or logically, a comma). Try replacing spaces with an underscore.
Ex:
reportName = rep.Name
TO
reportName = Replace(rep.Name," ","_")
I believe you have the Sub routenes printReportPDF and checkOutputFile defined in the macro. If they are not existing you would get a similiar error.