Exporting to PDF from Access vba RRS feed

  • Question

  • I am exporting a report as pdf from Access 2007. I have a macro setup that calls the routine in vb to export the report. When I run the macro manually everything works fine. But when it runs from a scheduled task the font size is very large on the exported report. has anyone ever seen this issue before and is there a solution for it? Is there a way to set the font when the reprot is exported from access?

    Here is the code I am using:

        FileDir = "C:\Reports\"

        FileName = "SummaryRpt.pdf"
        FlNm1 = FileDir & FileName
        chkfile = Dir(FlNm1)
        If chkfile <> "" Then
          Kill (FlNm1)
        End If

        DoCmd.OpenReport "rptSummaryRpt", acViewPreview, "", acHidden
        DoCmd.OutputTo acReport, "rptSummaryRpt", "PDF Format(*.pdf)", FlNm1, False, ""
        DoCmd.Close acReport, "rptSummaryRpt"

    • Moved by Mike Feng Monday, July 4, 2011 11:24 AM VBA (From:Visual Basic General)
    Friday, July 1, 2011 8:31 PM

All replies

  • Are you sure you aren't just opening Adobe Reader and getting some ridiculous huge zoom level?  I've noticed that since mine auto-updated itself to Reader 10, the stupid thing arbitrarily opens up between 175% and 250% - it does not recall the zoom level that was set on the last viewing.
    It never hurts to try. In a worst case scenario, you'll learn from it.
    Friday, July 1, 2011 8:40 PM
  • Try this:
    DoCmd.OutputTo acOutputReport, "rptSummaryRpt", "PDFFormat(*.pdf)", FlNm1,False, "", , acExportQualityPrint


    Friday, July 1, 2011 9:50 PM
  • Hi J-Bal,

    Welcome to the MSDN Forum.

    I have move this thread to the more appropriate forum.

    Best regards,

    Mike Feng [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, July 4, 2011 11:25 AM
  • Tried adding the 'acExportQualityPrint' to the statement and still got the same result.

    Are there any alternate ways to export to pdf (like there are for excel)?

    Wednesday, July 6, 2011 8:42 PM