When saving an Access report (XP) as a PDF (Acrobat Standard v.7) it doesn't save it in colour. When I open it it's just in B&W.
Does anyone know what setting I'm missing or do I need a different version of Acrobat?
Here's my code:
Public Sub PrintReportToAcrobat7(strReportName As String, strFileName As String, strErr As String)
On Error GoTo PrintReportToAcrobat7_Error
Dim sFileName As String
sFileName = strFileName
Set Application.Printer = Application.Printers("Adobe PDF")
'Registry settings ...
'Create the Registry Key where Acrobat looks for a file name
CreateNewRegistryKey HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl"
'Put the output filename where Acrobat could find it
SetRegistryValue HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl", _
Find_Exe_Name(CurrentDb.Name, CurrentDb.Name), _
sFileName
'Delete the file if it already exists
If Dir(sFileName) <> "" Then Kill sFileName
'On Error GoTo Err_handler
DoCmd.OpenReport strReportName, acViewNormal 'Run the report
While Len(Dir(sFileName)) = 0 ' Wait for the PDF to actually exist
DoEvents
Wend
'Close down the reports
DoCmd.Close acReport, strReportName, acSaveNo
Set Application.Printer = Nothing
PrintReportToAcrobat7_End:
Exit Sub
PrintReportToAcrobat7_Error:
strErr = Err.Description
Resume PrintReportToAcrobat7_End
End Sub
Does anyone know what setting I'm missing or do I need a different version of Acrobat?
Here's my code:
Public Sub PrintReportToAcrobat7(strReportName As String, strFileName As String, strErr As String)
On Error GoTo PrintReportToAcrobat7_Error
Dim sFileName As String
sFileName = strFileName
Set Application.Printer = Application.Printers("Adobe PDF")
'Registry settings ...
'Create the Registry Key where Acrobat looks for a file name
CreateNewRegistryKey HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl"
'Put the output filename where Acrobat could find it
SetRegistryValue HKEY_CURRENT_USER, _
"Software\Adobe\Acrobat Distiller\PrinterJobControl", _
Find_Exe_Name(CurrentDb.Name, CurrentDb.Name), _
sFileName
'Delete the file if it already exists
If Dir(sFileName) <> "" Then Kill sFileName
'On Error GoTo Err_handler
DoCmd.OpenReport strReportName, acViewNormal 'Run the report
While Len(Dir(sFileName)) = 0 ' Wait for the PDF to actually exist
DoEvents
Wend
'Close down the reports
DoCmd.Close acReport, strReportName, acSaveNo
Set Application.Printer = Nothing
PrintReportToAcrobat7_End:
Exit Sub
PrintReportToAcrobat7_Error:
strErr = Err.Description
Resume PrintReportToAcrobat7_End
End Sub