1. Create a ".aspx" Page and add one button to it.
2. GOTO Solution Explorer-> Right Click-> Add Reference-> Select Com Tab-> select "Microsoft PowerPoint 12.0.0.." COM Componet as a Reference to the project from the solution explorer.
3. All the following code in the code behind.
Imports System
Imports System.IO
Imports System.FileStyleUriParser
Imports Microsoft.Office.Interop
Imports System.String
Imports Microsoft.Office.Interop.PowerPoint
Partial Class Test_MSOffice
Inherits System.Web.UI.Page
Dim ppApp As PowerPoint.Application
Dim ppPres As PowerPoint.Presentation
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim strFileName As String
strFileName = "C:\Aspiration.ppt"
ppApp = New PowerPoint.Application
ppApp.Visible = True
ppPres = ppApp.Presentations.Open(filename:=strFileName)
ppPres = Nothing
ppApp = Nothing
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Calendar1.Visible = False
End Sub
End Class
No comments:
Post a Comment