2012-09-28 4 views
1

저는 인트라넷에 파워 포인트를 표시하는 최선의 방법을 찾기 위해 노력해 왔습니다. 회사의 사용자는 기술적 인 정보를 얻지 못하고 내가 설명 할 프로세스를 따르지 않을 수도 있습니다. .ppt를 .html로 자동 변환 할 수 있습니까?

내가 볼 수있는 HTML 페이지에 파워 포인트로 변환하는 방법을 보여줍니다 어떤이 page

을 발견했다. 나는이 과정을 자동화 할 방법이 있는지 알고 싶었다. 파일 감시자가 저장 한 위치를보고 나서 자동으로 보게되면 자동으로이 페이지가 제공된 페이지의 코드를 사용하여 html로 바뀝니다. 사용할 기본 언어는 VB.NET입니다.

사람들이 줄 수있는 제안에 만족합니다. 사전에

감사

+0

Alfresco, SharePoint, Confluence, http://slideshare.net, OpenOffice ...이 작업을 수행 할 수있는 기존 패키지가 있습니다. – MarkJ

답변

0

내가 사용했습니다 :

Imports PowerPoint = Microsoft.Office.Interop.PowerPoint 

자동으로 HTML에 파워 포인트를 변경할 수 있도록. 필자는 파일 감시자를 사용하여 내 컴퓨터의 디렉토리에서 .pptx로 설정되어있는 순간 파워 포인트 프리젠 테이션을주의 깊게 보았습니다. 그러나 다른 형식을 곧 추가하도록 변경하겠습니다. 이 fileWater는 컴퓨터가 시작할 때 시작되는 서비스에 있습니다. 그런 다음 파워 포인트 작성 또는 수정되었는지 확인 보이는이 코드를 실행 :이 수정 된 파일을 가져오고 HTML 문서로 저장

Private Shared Sub OnChanged(ByVal source As Object, ByVal e As FileSystemEventArgs) 
    'set varaibles so that html can save in correct place 
    Dim destinationDirectory As String = e.FullPath.Replace(e.Name.ToString(), "") 
    Dim sourceLocation As String 
    Dim fileName As String 
    'couple of if statements to get rid of unwanted characters 
    If e.Name.Contains("~$") Then 
     fileName = e.Name.Replace("~$", "") 
     fileName = fileName.Replace(".pptx", ".html") 
    Else 
     fileName = e.Name 
     fileName = fileName.Replace(".pptx", ".html") 
    End If 

    If e.FullPath.Contains(("~$")) Then 
     sourceLocation = e.FullPath.Replace("~$", "") 
    Else 
     sourceLocation = e.FullPath 
    End If 

    Dim strSourceFile As String = sourceLocation 'set source location after removing unwanted characters 
    Dim strDestinationFile As String = destinationDirectory & fileName 'set the destination location with the directory and file name 
    'set ppAPP to a power point application 
    Dim ppApp As PowerPoint.Application = New PowerPoint.Application 
    Dim prsPres As PowerPoint.Presentation = ppApp.Presentations.Open(strSourceFile, MsoTriState.msoTrue, MsoTriState.msoFalse, MsoTriState.msoFalse) 
    'Call the SaveAs method of Presentaion object and specify the format as HTML 
    prsPres.SaveAs(strDestinationFile, PowerPoint.PpSaveAsFileType.ppSaveAsHTML, MsoTriState.msoTrue) 
    'Close the Presentation object 
    prsPres.Close() 
    'Close the Application object 
    ppApp.Quit() 

End Sub 

. 또한 애니메이션을 저장 한 경우 실행해야하는 파일도 저장되므로 애니메이션도 저장됩니다.

1

당신이 코드를 시도 할 수 있습니다 -

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="AspNetPowerPointConvertToHTML.aspx.vb" Inherits="AspNetPowerPointConvertToHTML" %> 
<html> 
<head> 
<title>ShotDev.Com Tutorial</title> 
</head> 
<body> 
<form id="form1" runat="server"> 
<asp:Label id="lblText" runat="server"></asp:Label> 
</form> 
</body> 
</html> 

코드 뒤에 기능

보기 영문을 시도하기 위해 당신은 코드의 샘플을 Microsoft.Office.Interop.PowerPoint.Application

에 따라

Imports Microsoft.Office.Interop.PowerPoint 
Public Class AspNetPowerPointConvertToHTML 
Inherits System.Web.UI.Page 

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 

Dim ppApp As New Microsoft.Office.Interop.PowerPoint.Application 
Dim ppName As String = "MySlides.ppt" 
Dim FileName As String = "MyPP/MyPPt" 

ppApp.Visible = True 

ppApp.Presentations.Open(Server.MapPath(ppName)) 
ppApp.ActivePresentation.SaveAs(Server.MapPath(FileName), 13) 
ppApp.Quit() 
ppApp = Nothing 

Me.lblText.Text = "PowerPoint Created to Folder <strong> " & FileName & "</strong>" 

End Sub 
End Class 
+0

나는 이것을 시도하지는 않았지만 작동하는 것처럼 보입니다. 나는 다른 것을 할 수 있었다. – TeamGB

관련 문제