How to convert PowerPoint to HTML

Source: Internet
Author: User
How erp| conversions are used. NET to convert PowerPoint to HTML file
Of course we're going to use COM components, so we're going to install powerpoint2000, add a refrence to Vs.net and find Microsoft PowerPoint Object Library 9.0, add it in.
Then write the following code, very simple, I do not have to explain:
Using System;
Using Office;
Using PowerPoint;

Namespace Courseserver.course
{
<summary>
Author: Wang Hongsu
version:1.0
Date:2001/6/9
Description: Convert PowerPoint's PPT file to HTML file
</summary>
public class Convertpowerpoint
{
<summary>
Establish a reference to a powerpoint.application COM component
</summary>
Private powerpoint.application ppt;
<summary>
point to specific documents;
</summary>
Private Powerpoint.presentation Pptfile;
private string _htmlfilename;
<summary>
Write-only property to set the file path of the saved HTML file
</summary>
public string Htmlfilename
{
Set
{
_htmlfilename=value;
}
}

<summary>
Construction device
</summary>
Public Convertpowerpoint ()
{
//
Todo:add constructor Logic here
//

Ppt=new powerpoint.application ();
}
<summary>
Conversion process
</summary>
<param name= "Pptfilename" > PowerPoint file name to convert </param>

public void Convert (string pptfilename)
{

Pptfile=ppt. Presentations.Open (Pptfilename,office.msotristate.msotrue,office.msotristate.msoctrue, Office.MsoTriState.msoFalse);
Pptfile.saveas (_htmlfilename,powerpoint.ppsaveasfiletype.ppsaveashtml,office.msotristate.msoctrue);
Pptfile.close ();


}
}
}


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.