Change report output to pdf

Posted on 2011-05-11
Last Modified: 2012-05-11
Hi,  We recently migrated to Office 2010 from Office 2000.  New access doesn't support .snp files and want to get rid of snp viewers on all of my users - one less thing to support.  I have the following code written to send a snapshot report but am stuck on how to format my code to output a pdf file.  

Specifically, I'm having trouble converting this line:
DoCmd.OutputTo acReport, , "SnapshotFormat(*.snp)", strSNPFilePath

As far as I know, access2010/office2010 allows write to pdf?
Private Sub closeform_Click()
On Error GoTo Err_closeform_Click

If (Status <> "Rejected" And Status <> "Cancelled") Then
    If Listings = True Then
        If QINoticeFlag = False Then
            ''SEND EMAIL to QI for Listing submittal
            Dim strSNPFilePath As String
            Call MakeSureDirectoryPathExists("n:\EDM_attachments\ECN_" & Me.ECNNo & "\")
            strSNPFilePath = "N:\EDM_Attachments\ECN_" & ECNNo & "\ECN" & Me.ECNNo & "Report1.snp"
            DoCmd.OpenReport "ChangeReportQI", acViewPreview
            DoCmd.OutputTo acReport, , "SnapshotFormat(*.snp)", strSNPFilePath
            DoCmd.Close acReport, "ChangeReportQI"

            Dim Outlook
            Set Outlook = CreateObject("Outlook.Application")
            Dim Message 'As Outlook.MailItem
            Set Message = Outlook.CreateItem(olMailItem)
            With Message
            .Subject = "ECN #" & ECNNo & " requires a listing submittal"
            .Body = "Items on ECN NO. " & [ECNNo] & ", Titled: " & [Title] & vbCrLf & _
            ", Descr. of Change: " & [Forms]![frmECNMain]![ChangeDescr] & "; requires a listing submittal for UL,FM,NSF or other.  Contact the VP Engineering for details." & _
            "  A summary of this ECN is available at " & "<A href=" & "file://N:\EDM_Attachments\ECN_" & ECNNo & "\ECN" & ECNNo & "Report1.snp"""

            .Recipients.Add ("bobi")
            End With
            MsgBox "Notice has been sent to the QAM to submit a listing submittal against this ECN.", , "Notice Sent"
            QINoticeFlag = True
        End If

Open in new window

Question by:valmatic
    LVL 42

    Expert Comment

    from access 2007 help:

    You can save as a PDF or XPS file from a 2007 Microsoft Office system program only after you install an add-in. For more information, search for "Enable support for other file formats, such as PDF and XPS" on Office Online
    LVL 7

    Author Comment

    Oh, so even access 2010 does not natively support PDF write?  That blows, the rest of the office suite does.  
    LVL 7

    Accepted Solution

    I think I figured it out.  2010 does natively support PDF.

    Here's what I need to change...  

    DoCmd.OutputTo acReport, , acFormatPDF, strSNPFilePath
    LVL 26

    Expert Comment

    Yeah, 2010 supports PDF out of the box.
    2007, to keep Adobe's yap shut and avoid anti-trust problems, required a one-time download
    LVL 7

    Author Closing Comment

    Wrong info given.  I found answer myself.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now