Click here to Skip to main content
12,406,333 members (65,856 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB PDF VB.NET Powerpoint
I have a program that batch converts MS Word and MS Excel files to PDF’s. The VB program uses ExportasFixedFormat to create the PDF’s which works great. I’ve been asked to change the program so that it also converts MS PowerPoint files. I have gotten everything to work but there is one slight issue. When the program converts a PowerPoint file, PowerPoint displays a small form with a progress bar that shows the publishing progress. I would like to convert the PowerPoint files totally silent. I have tried using SaveAs and it also shows the progress bar. Neither Excel or Word shows the progress bar. Does anyone have any ideas on how to do this?

Module PowerPointToPDF
    Public Function ConvertPowerPointToPDF(ByVal InputFilePath As String, ByVal OutputFilePath As String) As Integer
        Dim Errors As Integer = 0
        Dim PPApplication As ApplicationClass = Nothing
        Dim PPDoc As Presentation = Nothing

            ' Start an instance of PowerPoint
            PPApplication = New ApplicationClass()
            'PPApplication.Visible = True

            ' Open the source document.
            PPDoc = PPApplication.Presentations.Open(InputFilePath, WithWindow:=False)
            PPDoc.SaveAs(OutputFilePath, PpSaveAsFileType.ppSaveAsPDF)
            'PPDoc.ExportAsFixedFormat(OutputFilePath, PpFixedFormatType.ppFixedFormatTypePDF, PpFixedFormatIntent.ppFixedFormatIntentScreen, Microsoft.Office.Core.MsoTriState.msoCTrue, PpPrintHandoutOrder.ppPrintHandoutHorizontalFirst, PpPrintOutputType.ppPrintOutputBuildSlides, Microsoft.Office.Core.MsoTriState.msoFalse, , , , False, False, False, False, False)

        Catch ex As Exception
            Errors = 1
            ' Close and release the Document object.
            If Not PPDoc Is Nothing Then
                PPDoc = Nothing
            End If
            ' Quit PowerPoint and release the ApplicationClass object.
            If Not PPApplication Is Nothing Then
                PPApplication = Nothing
            End If
        End Try
        Return Errors
    End Function
End Module
Posted 1-Jun-12 5:48am
losmac 1-Jun-12 11:57am
Which version of PP?
Shahpekan 30-Oct-12 0:03am
why cannot do import ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.160726.1 | Last Updated 1 Jun 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100