Convert PowerPoint Presentation To HTML

This page shows how to automate PowerPoint in various languages. The function converts PowerPoint presentation to HTML.

JavaScript

<SCRIPT Language = "JScript">
function ConvertPPT2HTML(PPTFileName, HTMLFileName)
{
    var Pres;
    var App;

    App = new ActiveXObject("PowerPoint.Application");
    Pres = App.Presentations.Open(PPTFileName, false, false, false);
    Pres.SaveAs(HTMLFileName, 12, false);
    Pres.Close();
    App.Quit();
}
ConvertPPT2HTML("C:\\Test.ppt", "C:\\Test.html")
</SCRIPT>

Visual Basic

Sub ConvertPPT2HTML(ByVal PPTFileName As String, _
    ByVal HTMLFileName As String)

    Dim PPT As Object
    Dim Pres As Object

    Set PPT = CreateObject("PowerPoint.Application")
    Set Pres = PPT.Presentations.Open(PPTFileName, False, False, False)

    Pres.SaveAs HTMLFileName, 12, False
    Pres.Close
    PPT.Quit

    Set Pres = Nothing
    Set PPT = Nothing
End Sub

Delphi

uses
  ComObj;

procedure ConvertPPT2HTML(PPTFileName, HTMLFileName: string);
var
  PPT: Variant;
  Pres: Variant;
begin
  PPT := CreateOleObject('PowerPoint.Application');
  Pres := PPT.Presentations.Open(PPTFileName, False, False, False);
  Pres.SaveAs(HTMLFileName, 12, False);
  Pres.Close;
  PPT.Quit
end;

Contact OfficeOne on email at officeone@officeoneonline.com. Copyright © 2001-2018 OfficeOne. All rights reserved.