An implementation method for Office document online Editing _ Web page Editor

Source: Internet
Author: User
The version after Office XP supports direct editing of files on the server through the WebDAV protocol (HTTP extensions).
IIS (6.0) supports WebDAV, which is visible in the Web service extensions of IIS Manager. With IIS as the server side of WebDAV, you can easily implement online editing of office (Word,excel, etc.).
Can be simple to experiment:
Make sure that the WebDAV extensions for IIS are installed and enabled, set up a virtual directory test, place a Word document A.doc in it, and then open Word, and the file-> open-> Enter the access URL (http://localhost/test/a.doc) for the Word document.
Modify the contents of the document, save it, what happened? The document was saved to the server.
In IE, you can create word.application through JS to open, modify the document on the server.
Copy Code code as follows:

Wapp = new ActiveXObject ("word.application.11");
Wapp.visible = true;
WApp.Documents.Open (URL);
if (trackrevisions) {//can achieve trace reservation
WApp.ActiveDocument.TrackRevisions = true;
WApp.ActiveDocument.ShowRevisions = false;
}else
{
WApp.ActiveDocument.TrackRevisions = false;
WApp.ActiveDocument.ShowRevisions = false;
}
Wapp.activedocument.application.username= Global_currentusername;

Also, when you install Office, you press an ActiveX component: Sharepoint.opendocuments, can you use this component to activate Word, edit the document on the server: var __opendocuments = null;
Copy Code code as follows:

function document_edit2 (URL)
{
if (__opendocuments = null) br>{
try{
__opendocuments = new ActiveXObject ("sharepoint.opendocuments.3");//for Office 2007
}catch (e) {}
if (__opendocuments = null | | typeof (__opendocuments) = = "#ff0000")
{
try{
__opendocuments = New ActiveXObject ("Sharepoint.opendocuments.2"); For Office 2003
}catch (e) {}
}
if (__opendocuments = null | | typeof (__opendocuments) = "undefined")
{
Alert ("Please install Word (2003 or later)");
return;
}
}
//Opendocobj.viewdocument ("Http://www.abc.com/documents/sample.doc");, "Word.Document"
//opend Ocobj.createnewdocument ("Http://www.abc.com/documents/sampleTemplate.dot", "http://www.abc.com/documents/");
var result = __opendocuments.editdocument (URL, "Word.Document");
if (result = = False)
{
Alert ("Cannot open document.");
}
}

As you can see, based on WebDAV support for IIS, you can easily edit an Office document online, but there is a problem: So the document is stored on the file system, in many of our systems,
The document is stored in the database, so how do you implement it???
I tried a lot and found the solution. It'll be in the next article.

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.