PowerPoint Viewer Component

> Edraw Tip > PowerPoint Viewer Component
author
Posted by James Freeman |
Edraw PowerPoint Viewer Component let the developers integrate MS PowerPoint easily for creating and playing back standard slideshow-style presentations with the MS PowerPoint Windows from own project.

PowerPoint Viewer Component

Click Here to Download Office Viewer Component - Support MS PowerPoint, Excel, Word, Visio and Project

free download5 MB

Microsoft PowerPoint is a very popular program used in the world. Many people need to embed PowerPoint presentations to be viewed in a Web page or form. If the user's computer has installed the MS PowerPoint, it's completely unnecessary to parse the different version PowerPoint file format. With Edraw Office Viewer Component, it is easy to embed MS PowerPoint program in any project which supports the ActiveX Control such as asp.net, vb.net, c#, c++, delphi, php, etc. There is no worry of the format compatible problem.

The PowerPoint Viewer Component have wrapped the basic PowerPoint automation code in a behavior to make it easy to use. You simply drop it onto the form or html page then add the script. All are easy. In the install package, you can find lots of sample projects written in different development languages.

The following codes are from a simple vb.net project.

Create a New PowerPoint

Private Sub btnNew_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnNew.Click
AxEDOffice1.CreateNew("PowerPoint.Application")
End Sub

Open a PowerPoint File

Private Sub btnOpen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpen.Click
AxEDOffice1.OpenFileDialog()
End Sub

Save As...

Private Sub btnSaveAs_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSaveAs.Click
AxEDOffice1.SaveFileDialog()
End Sub

Close File

Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
AxEDOffice1.CloseDoc()
End Sub

Print PowerPoint File

Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
AxEDOffice1.PrintDialog()
End Sub

Do Print Preview

Private Sub btnPreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPreview.Click
AxEDOffice1.PrintPreview()
End Sub

The PowerPoint Component also includes some methods to play the slide show.

boolean SlideShowPlay([in] VARIANT_BOOL bLoopUntilStopped);
Plays the slide show file.

Example
The following java script shows how to play the slide show from slide 2.
function EDOffice1_DocumentOpened()
{
EDOffice1.SlideSetStartingSlide(2);
EDOffice1.SlideShowPlay(true);
}
<script language="javascript" for=" EDOffice1" event="DocumentOpened">
EDOffice1_DocumentOpened();
</script>

boolean SlideShowExit();
Exits the slide show play window.

boolean SlideGotoFirst();
Goes to the first slide in the opened PowerPoint file.

boolean SlideGotoPrevious();
Goes to the previous slide in the opened PowerPoint file.

boolean SlideGotoNext();
Goes to the next slide in the opened PowerPoint file.

boolean SlideGotoLast();
Goes to the last slide in the opened PowerPoint file.

boolean SlideGotoPage([in] long nPage);
Goes to the specified slide in the opened PowerPoint file based on the index.

long SlideGetCount();
Returns the count of slides.

long SlideGetCurrentShowPosition();
Returns the current show position of slides.

boolean SlideSetStartingSlide([in] long Start);
Sets the starting slide.

boolean SlideSetEndingSlide([in] long End);
Sets the ending slide.

boolean SlideExportSlideToImage([in] long Index, [in] BSTR FilePath, [in] BSTR FilterName, [in, optional] VARIANT Width, [in, optional] VARIANT Height);

Exports the slide to image.

Index: The index of the slide.
FilePath: The name of the file to be exported and saved to disk. You can include a full path; if you don't, Microsoft PowerPoint creates a file in the current folder.
FilterName: The graphics format in which you want to export slides. The specified graphics format must have an export filter registered in the Windows registry. You can specify either the registered extension or the registered filter name. Microsoft Office PowerPoint will first search for a matching extension in the registry. If no extension that matches the specified string is found, PowerPoint will look for a filter name that matches.
Width: The width in pixels of an exported slide.
Height: The height in pixels of an exported slide.

Example
The following java script shows how to export slide into jpg file.

function ExportSlide_Example ()
{
edoffice.SlideExportSlideToImage(1, "d:\1.jpg", "JPG");
}

Automating PowerPoint

Programmers can automate the Microsoft PowerPoint applications by using VBA, and when combined with VBScript, they have a very powerful tool at their disposal. The component provides two methods which return the Application and Presentation interface of the opened MS PowerPoint Presentation. The developers can add the following Key Code in the DocumentOpened event of the component.

For Example: KEY CODE in VB

Dim appPPT As PowerPoint.Application
Set appPPT = EDOffice1.GetApplication()
Dim oPre As PowerPoint.Presentation
Set oPre = EDOffice1.ActiveDocument()

Then the developers can do the PowerPoint automation without any difference.

Embed MS Office in ASP.NET Program

Embedding MS Project

Embedding Visio

Disables MS Word Standard Command

Disable Office Ribbon Button

Show/Hide Office Menu Bar

Office ActiveX Control

download EdrawMind
main page

Get Started! You Will Love This Easy-To-Use Diagram Software

EdrawMax is an advanced all-in-one diagramming tool for creating professional flowcharts, org charts, mind maps, network diagrams, UML diagrams, floor plans, electrical diagrams, science illustrations, and more. Just try it, you will love it!