讓自己的網站實現在線編輯office文檔


我們可以通過Office Web Apps(OWA)來實現在線編輯word,excel,power point, one note,並集成到自己的網站里去。

 

1 准備工作

1.1 操作系統

  • 安裝了帶 Windows Server 2008 R2 x64 Edition 更新程序的 Windows Server 2008 R2 Service Pack 1 (SP1) Standard、Enterprise 或 Datacenter 的 64 位版本

  • Windows Server 2012 Standard 或 Datacenter 的 64 位版本

  • 64 位版本的 Windows Server 2012 R2。若要使用此操作系統,則必須使用 Office Web Apps Server Service Pack 1 (SP1)。

image

1.2 域要求

需要二台服務器,一台做域控,另一台安裝OWA。

1號坑:注意域控上安裝OWA是不起作用的

 

詳情請參考官方文檔:https://technet.microsoft.com/zh-cn/library/jj219435#software

 

2 創建域控

Windows Server 2012之搭建域控制器DC

 

3 加域

 

3.1 加域方法

首先把DNS指向域控:

image

 

 

然后,開始加域:

image

 

3.2 錯誤處理

如果加域時出現下面的錯誤:

The domain join cannot be completed because the SID of the domain you attempted to join was identical to the SID of this machine

image

解決辦法如下:

1. 打開command

2. 改變路徑 %WINDIR%\system32\sysprep

3.  運行sysprep /oobe /generalize

這時,就會出現下面的界面,完成后,會重新啟動。注意這里可能會把ip會清掉。

image

 

 

4 安裝OWA

參考《Office Web Apps安裝部署(一)

5 測試

5.1 測試view

運行 /op/generate.aspx">/op/generate.aspx">/op/generate.aspx">http://<ServerName>/op/generate.aspx , 輸入文件名,然后生成link,測試在線看的功能:

image

 

5.2 測試edit

下載demo:https://code.msdn.microsoft.com/Building-an-Office-Web-f98650d6

修改下面配置內容 :

<add key="appWopiServer"        value="http://youda.hpe.com:81/api/wopi/files/" />

發布之后,就可以測試了:《Asp.net與office web apps的整合》。

 

2號坑: 我先嘗試用localhost,外部的文件path,都沒成功,后面發布到網站上,用這個網站里面的文檔就成功了。

3號坑:這個demo里word的edit功能還沒實現。

 

官方技術文檔:  https://wopi.readthedocs.org/en/latest/intro.html

 

 

在線那些事


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM