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 5: Convert a PowerPoint document into PDF from Visual Basic  Print Example 

Sub PowerPointConverter()

   Dim documentToConvert : documentToConvert="c:\test.ppt"
 
   Dim DPSDK : Set DPSDK = CreateObject("docuPrinter.SDK")
   DPSDK.BackupSettings
 
   DPSDK.DocumentOutputFormat = "PDF"
   DPSDK.DocumentOutputName = "demoPPT"
   DPSDK.DocumentOutputFolder = "c:\"
 
   DPSDK.PDFAutoRotatePage = "PageByPage"
 
   DPSDK.HideSaveAsWindow = true
   DPSDK.DefaultAction=1
 
   DPSDK.ApplySettings
 
   Dim MSPowerPoint 
   Set MSPowerPoint = CreateObject("PowerPoint.Application")
 
   Dim PPTDoc 
   Set PPTDoc = MSPowerPoint.Presentations.Open(documentToConvert, -1, 0, 0)
   PPTDoc.PrintOptions.PrintInBackground=0
   PPTDoc.PrintOptions.PrintColorType=1
   PPTDoc.PrintOptions.ActivePrinter="docuPrinter"
   PPTDoc.PrintOut 0
   PPTDoc.Close
   MSPowerPoint.Quit
   Set MSPowerPoint = Nothing
 
   Dim RVal : RVal = DPSDK.Create ' Create output document 
   DPSDK.RestoreSettings
   Set DPSDK = Nothing
 
   If (RVal <> 0) Then 
     MsgBox "Error while converting the document!!!"
   Else
     MsgBox "Done converting!!!"
   End If
 
End Sub



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