Neevia Technology Sites:   www.neevia.com  |  docuPub.com  |  www.neeviaPDF.com
:: Home :: Products :: Technical Support :: About Us :: Contact Us
Technical support > Neevia docuPrinter SDK code samples
Example 7: Convert a MS Access report into PDF from Visual Basic  Print Example 

Sub AccessConverter()

   Dim DPSDK : Set DPSDK = CreateObject("docuPrinter.SDK")
   DPSDK.BackupSettings
 
   DPSDK.DocumentOutputFormat = "PDF"
   DPSDK.DocumentOutputName = "demoAccess"
   DPSDK.DocumentOutputFolder = "c:\"
 
   DPSDK.DocumentResolution = 300
 
   DPSDK.HideSaveAsWindow = true
   DPSDK.DefaultAction=1
 
   DPSDK.ApplySettings
 
   Dim objAccess
   Set objAccess = CreateObject("Access.Application")
 
   Dim defPrinter : defPrinter=DPSDK.GetDefaultPrinter
 
   DPSDK.SetDefaultPrinter "docuPrinter"
   objAccess.OpenCurrentDatabase "c:\access.mdb", true
 
   objAccess.DoCmd.OpenReport "rptCatalog", 0
   'rptCtatalog is the repport name
 
   objAccess.Quit 2
   Set objAccess=nothing
   
   RVal = DPSDK.Create ' Create output document
   If (RVal <> 0) Then MsgBox "Error. Create returns "+CStr(Rval)
 
   DPSDK.SetDefaultPrinter defPrinter

   DPSDK.RestoreSettings
   Set DPSDK = Nothing
 
   MsgBox "Done converting!!!"

End Sub



Copyright © 1999-2016 Neevia Technology. All Rights Reserved. Home | Products | Technical Support | About Us | Contact Us