Convert PowerPoint Document to HTML in C#, VB.NET

Spire.Presentation supports to convert PowerPoint documents to a variety kinds of file formats such as Image, PDF, SVG and HTML. This article focuses on demonstrating how to convert PowerPoint document to HTML using Spire.Presentation.

Below screenshot shows what the example document looks like:

Convert PowerPoint Document to HTML in C#, VB.NET

Detail steps:

Step 1: Initialize an object of Presentation class.

Presentation ppt = new Presentation();

Step 2: Load the PowerPoint document.

ppt.LoadFromFile("Sample.pptx");

Step 3: Save the document to HTML format.

ppt.SaveToFile(@"E:\Program Files\ToHtml.html", FileFormat.Html);

Screenshot:

Convert PowerPoint Document to HTML in C#, VB.NET

Full code:

[C#]
using Spire.Presentation;

namespace Convert_PowerPoint_To_Html
{
    class Program
    {
        static void Main(string[] args)
        {
            //Initialize an object of Presentation class
            Presentation ppt = new Presentation();
            //Load the PowerPoint document
            ppt.LoadFromFile("Sample.pptx");

            //Save the PowerPoint document to HTML format
            ppt.SaveToFile(@"E:\Program Files\ToHtml.html", FileFormat.Html);
        }
[VB.NET]
Imports Spire.Presentation

Namespace Convert_PowerPoint_To_Html
	Class Program
		Private Shared Sub Main(args As String())
			'Initialize an object of Presentation class
			Dim ppt As New Presentation()
			'Load the PowerPoint document
			ppt.LoadFromFile("Sample.pptx")

			'Save the PowerPoint document to HTML format
			ppt.SaveToFile("E:\Program Files\ToHtml.html", FileFormat.Html)
		End Sub
	End Class
End Namespace