Using Microsoft Add-Ins (1 Viewer)

Fasopus

Registered User.
Local time
Today, 05:55
Joined
Jun 9, 2010
Messages
58
So I've been looking for a way to automatically save my reports as PDFs in Access 2007. I have downloaded and installed the Microsoft add-in that is supposed to allow this. I can see the add-in inside of the office menu and it works fine, but I'm looking to tie it to a button with some VBA code or a macro behind it and I can't seem to find the proper command to access the add-in.
 

DCrake

Remembered
Local time
Today, 10:55
Joined
Jun 8, 2005
Messages
8,632
Here is a code snippet I use to print reports to PDF in 2007. Have you installed the add-in OutputToPDF from MS?

Code:
Private Sub OutputReports()
Dim sSendObjectOutputFileType As String
    Dim sOutputToFileType As String
    Dim sOutputToFileTypeExtension As String
    Dim sVersionOfAccess As String
    If (SysCmd(SYSCMD_ACCESSVER)) = "12.0" Then
        sVersionOfAccess = "Access2007"
[COLOR="Red"]        sSendObjectOutputFileType = "PDF Format (*.pdf)"
        sOutputToFileType = acFormatPDF
        sOutputToFileTypeExtension = ".pdf"[/COLOR]    
Else
        sVersionOfAccess = "Access2003"
        sSendObjectOutputFileType = "SnapshotFormat(*.snp)"
        sOutputToFileType = acFormatSNP
        sOutputToFileTypeExtension = ".snp"
    End If
    Dim sOutputPath As String
    Dim sOutputFileName As String
    
    sOutputPath = CurrentProject.Path & "\"
    sOutputFileName = SnapReportName
    
    StrDefaultPathAndFileName = sOutputPath & SnapReportName & sOutputToFileTypeExtension
    If Dir(StrDefaultPathAndFileName) <> "" Then
        Kill StrDefaultPathAndFileName
        DoEvents
    End If
        
    DoCmd.OutputTo acOutputReport, SnapReportName, sOutputToFileType, sOutputPath & sOutputFileName & sOutputToFileTypeExtension, True
End Sub
 

Fasopus

Registered User.
Local time
Today, 05:55
Joined
Jun 9, 2010
Messages
58
Yes I do believe that is the add-in I downloaded, I will give your code a try and see if it works out for me, thanks!
 

Users who are viewing this thread

Top Bottom